kennknowles commented on code in PR #33419:
URL: https://github.com/apache/beam/pull/33419#discussion_r1922813079


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/fn/stream/DirectStreamObserver.java:
##########
@@ -69,7 +69,7 @@ public DirectStreamObserver(Phaser phaser, 
CallStreamObserver<T> outboundObserve
   @Override
   public void onNext(T value) {
     synchronized (lock) {
-      if (++numMessages >= maxMessagesBeforeCheck) {
+      if (++numMessages > maxMessagesBeforeCheck) {

Review Comment:
   Yea it is a boundary condition in the test.
   
   - Initially: numMessages=0
   - message 0: ++numMessages = 1; no check; test puts it in bucket 0
   - message 1: ++numMessages = 2; check passes/reset; test increments bucket; 
test puts it in bucket 1; 
   - message 2: ++numMessages = 1; no check; test puts it in bucket 1
   - message 3: ++numMessages = 2; check passes/reset; test increments bucket; 
test puts it in bucket 2
   - message 4: ++numMessages = 1; no check; test increments bucket; test puts 
it in bucket 2
   - etc
   
   



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