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


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/util/BoundedQueueExecutor.java:
##########
@@ -73,7 +74,8 @@ public BoundedQueueExecutor(
           protected void beforeExecute(Thread t, Runnable r) {
             super.beforeExecute(t, r);
             synchronized (BoundedQueueExecutor.this) {
-              if (++activeCount >= maximumPoolSize && 
startTimeMaxActiveThreadsUsed == 0) {
+              if (++activeCount >= BoundedQueueExecutor.this.maximumPoolSize

Review Comment:
   how about naming the method param initialMaximumPoolSize instead of using 
this.BQE.maximumPoolSize here?
   Then there won't be the confusion and using initialMaximumPoolSize here 
would be obviously incorrect



##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/util/BoundedQueueExecutor.java:
##########
@@ -73,7 +74,8 @@ public BoundedQueueExecutor(
           protected void beforeExecute(Thread t, Runnable r) {
             super.beforeExecute(t, r);
             synchronized (BoundedQueueExecutor.this) {
-              if (++activeCount >= maximumPoolSize && 
startTimeMaxActiveThreadsUsed == 0) {
+              if (++activeCount >= BoundedQueueExecutor.this.maximumPoolSize

Review Comment:
   can you improve the unit test to catch this? there are separate tests for 
changing limit and calculating the time but one with both could catch this.



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