scwhittle commented on code in PR #33580:
URL: https://github.com/apache/beam/pull/33580#discussion_r1925257235
##########
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:
currentActiveWorkBudget is public and called without synchronized currently,
but it is also just used by test method.
--
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]