You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "AntonVasant (via GitHub)" <gi...@apache.org> on 2025/11/22 11:14:31 UTC
[PR] MINOR: Improve heartbeat error logging by downgrading transient Timeo… [kafka]
AntonVasant opened a new pull request, #20965:
URL: https://github.com/apache/kafka/pull/20965
This PR improves the logging behavior in AbstractHeartbeatRequestManager when the heartbeat
response is null due to an exception.
Currently, TimeoutException / DisconnectException are logged at ERROR level with full stacktrace,
even though these are normal operational conditions (e.g., broker down, network turbulence).
The classic KafkaConsumer logs such cases at WARN, and the Jira ticket KAFKA-19891 confirms that
the async consumer should behave consistently.
This PR:
* Logs TimeoutException and DisconnectException at WARN (without stacktrace)
* Logs all other exceptions at ERROR (with stacktrace)
No functional behaviour has been changed.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-19891: Suppress error-level heartbeat logs during consumer close [kafka]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20965:
URL: https://github.com/apache/kafka/pull/20965#issuecomment-3988548478
This PR is being marked as stale since it has not had any activity in 90 days. If you
would like to keep this PR alive, please leave a comment asking for a review. If the PR has
merge conflicts, update it with the latest from the base branch.
<p>
If you are having difficulty finding a reviewer, please reach out on the
[mailing list](https://kafka.apache.org/contact).
<p>
If this PR is no longer valid or desired, please feel free to close it. If no activity
occurs in the next 30 days, it will be automatically closed.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-19891: Suppress error-level heartbeat logs during consumer close [kafka]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #20965: KAFKA-19891: Suppress error-level heartbeat logs during consumer close
URL: https://github.com/apache/kafka/pull/20965
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-19891: Suppress error-level heartbeat logs during consumer close [kafka]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20965:
URL: https://github.com/apache/kafka/pull/20965#issuecomment-4174531814
This PR has been closed since it has not had any activity in 120 days. If you feel like this
was a mistake, or you would like to continue working on it, please feel free to re-open the
PR and ask for a review.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-19891: Suppress error-level heartbeat logs during consumer close [kafka]
Posted by "kirktrue (via GitHub)" <gi...@apache.org>.
kirktrue commented on code in PR #20965:
URL: https://github.com/apache/kafka/pull/20965#discussion_r2579181541
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/StreamsGroupHeartbeatRequestManager.java:
##########
@@ -486,7 +493,10 @@ private NetworkClientDelegate.UnsentRequest makeHeartbeatRequestAndLogResponse(f
else
logger.error("StreamsGroupHeartbeatRequest failed because of {}: {}", error, response);
} else {
- logger.error("StreamsGroupHeartbeatRequest failed because of unexpected exception.", exception);
+ if (isClosed) {
+ logger.debug("StreamsGroupHeartbeatRequest failed because of exception during close: ", exception);
+ } else
+ logger.error("StreamsGroupHeartbeatRequest failed because of unexpected exception: ", exception);
Review Comment:
Same here: both the `if` and the `else` should use brackets _or_ both `if` and the `else` branches should _not_ use brackets.
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractHeartbeatRequestManager.java:
##########
@@ -315,7 +322,10 @@ private NetworkClientDelegate.UnsentRequest logResponse(final NetworkClientDeleg
else
logger.error("{} failed because of {}: {}", heartbeatRequestName(), error, response);
} else {
- logger.error("{} failed because of unexpected exception.", heartbeatRequestName(), exception);
+ if (isClosed) {
+ logger.debug("{} failed because of exception during close: {}", heartbeatRequestName(), exception);
+ } else
+ logger.error("{} failed because of unexpected exception: {}", heartbeatRequestName(), exception);
Review Comment:
Nitpicky, sure, but I think we should be consistent with the use of the brackets.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Improve heartbeat error logging by downgrading transient Timeo… [kafka]
Posted by "AntonVasant (via GitHub)" <gi...@apache.org>.
AntonVasant commented on PR #20965:
URL: https://github.com/apache/kafka/pull/20965#issuecomment-3573384039
sure will make the changes
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org