mjsax commented on code in PR #22917:
URL: https://github.com/apache/kafka/pull/22917#discussion_r3639914165
##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java:
##########
@@ -1113,20 +1112,22 @@ public void maybeSendShutdown() {
if (assignmentErrorCode.get() ==
AssignorError.SHUTDOWN_REQUESTED.code()) {
final long now = time.milliseconds();
final long lastLogged = lastShutdownWarningTimestamp.get();
- if (now - lastLogged >= 10_000L) {
- if (lastShutdownWarningTimestamp.compareAndSet(lastLogged,
now)) {
- log.warn("Detected that shutdown was requested. " +
- "All clients in this app will now begin to
shutdown");
+ // The run loop calls this method on every iteration while a
shutdown is pending, and while
+ // the shutdown rebalance is in progress the thread polls
non-blocking, so throttle both the
+ // warning and the rebalance enforcement to at most once per 10s
to avoid flooding the logs.
+ // The first detection still fires immediately (lastLogged == 0),
so shutdown is not delayed.
Review Comment:
Useless comment. Let's remove it entirely.
--
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]