Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False warning log for not committed offsets on CooperativeStickyAssignor strategy #2991

Closed
hrabur opened this issue Jan 17, 2024 · 1 comment · Fixed by #2994
Closed

False warning log for not committed offsets on CooperativeStickyAssignor strategy #2991

hrabur opened this issue Jan 17, 2024 · 1 comment · Fixed by #2994

Comments

@hrabur
Copy link

hrabur commented Jan 17, 2024

spring-kafka:3.0.12 (code of main and 3.0.x branches show the same problem)

Recently we switched to partition.assignment.strategy: org.apache.kafka.clients.consumer.CooperativeStickyAssignor, as a consequence, we started to observe false positive warning messages during the restart of our service

These offsets could not be committed; partition(s) lost during rebalance: {}

The message led us to the following code in spring-kafka

this.logger.warn(() -> "These offsets could not be committed; partition(s) lost during rebalance: "

We believe the the warning is false positive, because as seen from the log message the uncommitted map is empty (... rebalance: {}), i.e. all offsets are properly committed.

As it is seen in the code the warning log message is printed always, without taking into consideration if uncommitted is empty or not

@artembilan
Copy link
Member

I think you are right and we can check for empty collection before printing that warning.

Please, consider to contribute the fix: https://github.com/spring-projects/spring-kafka/blob/main/CONTRIBUTING.adoc

@artembilan artembilan added this to the 3.1.2 milestone Jan 17, 2024
sobychacko added a commit to sobychacko/spring-kafka that referenced this issue Jan 17, 2024
Fixes: spring-projects#2991

There is a warning from `KafkaMessageListenerContainter#checkRebalanceCommits`
that unconditionally logs offsets not being committed. Because of this unconditional
check, the messages are very likely to be false positives. Fixing this by adding
a check to see if there are indeed uncommitted records.
sobychacko added a commit to sobychacko/spring-kafka that referenced this issue Jan 17, 2024
Fixes: spring-projects#2991

There is a warning log from `KafkaMessageListenerContainter#checkRebalanceCommits`
that unconditionally prints that offsets could not be committed. Because of this
unconditional check, the messages are very likely to be false positives. Fixing
this by adding a check to see if there are indeed uncommitted records.
artembilan pushed a commit that referenced this issue Jan 17, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fixes: #2991

There is a warning log from `KafkaMessageListenerContainter#checkRebalanceCommits`
that unconditionally prints that offsets could not be committed. Because of this
unconditional check, the messages are very likely to be false positives. Fixing
this by adding a check to see if there are indeed uncommitted records.
artembilan pushed a commit that referenced this issue Jan 17, 2024
Fixes: #2991

There is a warning log from `KafkaMessageListenerContainter#checkRebalanceCommits`
that unconditionally prints that offsets could not be committed. Because of this
unconditional check, the messages are very likely to be false positives. Fixing
this by adding a check to see if there are indeed uncommitted records.

(cherry picked from commit f9476a3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants