aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/buildeventservice
diff options
context:
space:
mode:
authorGravatar buchgr <buchgr@google.com>2018-07-17 08:31:58 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-07-17 08:33:22 -0700
commit59f915949e262ac526e8f7e3153502400d95b0ff (patch)
treef138721067be50b096a7f73927fc11c06f7964fb /src/main/java/com/google/devtools/build/lib/buildeventservice
parentb8977a4cd6cd3b2a83b0596d8e477f8d89988d8a (diff)
fix deadlock in the bes upload. Fixes #5402
The synchronized block in sendBuildEvent is not needed at all, since all the logic in there is local to the method and thread safe. See the issue for more details. RELNOTES: None PiperOrigin-RevId: 204915541
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/buildeventservice')
-rw-r--r--src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceTransport.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceTransport.java b/src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceTransport.java
index 0db5212615..36a4aa1b60 100644
--- a/src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceTransport.java
+++ b/src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceTransport.java
@@ -109,7 +109,7 @@ public class BuildEventServiceTransport implements BuildEventTransport {
/** Contains all events should be sent ordered by sequence number. */
private final BlockingDeque<InternalOrderedBuildEvent> pendingSend;
/** Holds the result status of the BuildEventStreamProtos BuildFinished event. */
- private Result invocationResult;
+ private volatile Result invocationResult;
/** Used to block until all events have been uploaded. */
private ListenableFuture<?> uploadComplete;
/** Used to ensure that the close logic is only invoked once. */
@@ -317,7 +317,7 @@ public class BuildEventServiceTransport implements BuildEventTransport {
}
@Override
- public synchronized void sendBuildEvent(BuildEvent event, final ArtifactGroupNamer namer) {
+ public void sendBuildEvent(BuildEvent event, final ArtifactGroupNamer namer) {
if (event instanceof BuildCompletingEvent) {
BuildCompletingEvent completingEvent = (BuildCompletingEvent) event;
if (completingEvent.getExitCode() != null
@@ -402,7 +402,7 @@ public class BuildEventServiceTransport implements BuildEventTransport {
}
}
- private synchronized Result getInvocationResult() {
+ private Result getInvocationResult() {
return invocationResult;
}