scwhittle commented on code in PR #33580:
URL: https://github.com/apache/beam/pull/33580#discussion_r1925127733


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/streaming/ActiveWorkState.java:
##########
@@ -219,14 +220,12 @@ synchronized ImmutableList<RefreshableWork> 
getRefreshableWork(Instant refreshDe
         .collect(toImmutableList());
   }
 
-  private void incrementActiveWorkBudget(Work work) {
-    activeGetWorkBudget.updateAndGet(
-        getWorkBudget -> getWorkBudget.apply(1, 
work.getSerializedWorkItemSize()));
+  private synchronized void incrementActiveWorkBudget(Work work) {
+    activeGetWorkBudget = activeGetWorkBudget.apply(1, 
work.getSerializedWorkItemSize());
   }
 
-  private void decrementActiveWorkBudget(Work work) {
-    activeGetWorkBudget.updateAndGet(
-        getWorkBudget -> getWorkBudget.subtract(1, 
work.getSerializedWorkItemSize()));
+  private synchronized void decrementActiveWorkBudget(Work work) {

Review Comment:
   how about removing this file from the PR and we can merge the rest?
   
   in invalidateStuckCommits we call a function under the sychronized block 
which could be contributing to deadlock. Or could be printActiveWork holding 
synchronized as it calls into Work



-- 
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