nicktelford commented on code in PR #22597:
URL: https://github.com/apache/kafka/pull/22597#discussion_r3426453500


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/GlobalStreamThread.java:
##########
@@ -301,6 +312,13 @@ public void run() {
                 }
                 stateConsumer.pollAndUpdate();
 
+                final long uncommittedLimit = maxUncommittedBytes;

Review Comment:
   I'm going to preempt some feedback here and clarify why we copy 
`maxUncommittedBytes` into a local `uncommittedLimit` variable here.
   
   The reason is that `maxUncommittedBytes` can be modified by another thread 
(the main thread) via `resizeMaxUncommittedBytes` below, when adding/removing 
StreamThreads to the running application. So we copy its value to a local 
temporary variable to ensure the value remains consistent across the 3 usages 
below.



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