m-trieu commented on code in PR #32774:
URL: https://github.com/apache/beam/pull/32774#discussion_r1837608239


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/windmill/client/AbstractWindmillStream.java:
##########
@@ -412,15 +420,17 @@ private void recordStreamStatus(Status status) {
     }
 
     /** Returns true if the stream was torn down and should not be restarted 
internally. */
-    private synchronized boolean maybeTeardownStream() {
-      if (hasReceivedShutdownSignal() || (clientClosed && 
!hasPendingRequests())) {
-        streamRegistry.remove(AbstractWindmillStream.this);
-        finishLatch.countDown();
-        executor.shutdownNow();
-        return true;
-      }
+    private boolean maybeTeardownStream() {
+      synchronized (AbstractWindmillStream.this) {

Review Comment:
   fixed by moving it out of the inner class
   GuardedBy check was failing since reference to `this` was ambiguous



##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/windmill/client/AbstractWindmillStream.java:
##########
@@ -412,15 +420,17 @@ private void recordStreamStatus(Status status) {
     }
 
     /** Returns true if the stream was torn down and should not be restarted 
internally. */
-    private synchronized boolean maybeTeardownStream() {
-      if (hasReceivedShutdownSignal() || (clientClosed && 
!hasPendingRequests())) {
-        streamRegistry.remove(AbstractWindmillStream.this);
-        finishLatch.countDown();
-        executor.shutdownNow();
-        return true;
-      }
+    private boolean maybeTeardownStream() {
+      synchronized (AbstractWindmillStream.this) {
+        if (isShutdown || (clientClosed && !hasPendingRequests())) {
+          streamRegistry.remove(AbstractWindmillStream.this);

Review Comment:
   fixed by moving it out of the inner class
   GuardedBy check was failing since reference to `this` was ambiguous



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to