-
Notifications
You must be signed in to change notification settings - Fork 108
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
NPE in ConsumerStateBatch.getCurrentRetryCount #1004
Comments
It is tough to provide a known exact fix for this without a definite reproducer (and I have not successfully been able to reproduce it in our test suite so far either), but I do think we should at least make some changes in My best guess is that it is a timing problem in the "slow" CI machine and the consumer hasn't yet been assigned a partition by Kafka (or it could be in the midst of being reassigned), and we need to account for that state. |
I would concur with that guess. The current workaround is to run a passing test case before testing the failure, giving Kafka the time to assign partitions and finish balancing. Defensive programming would make sense. I do think the Lines 170 to 176 in 01f2e37
For this specific exception, it is not |
Expected Behavior
Given a Kafka listener with retry enabled, when an exception is thrown from the listener, it should be retried.
Actual Behaviour
Steps To Reproduce
I can only reproduce this problem on a rather slow CI machine. I've tried to reproduce this locally, with no success. If anything I wouldn't expect an NPE and suspect that this may be due to a race condition. At a glance it looks like the
partitions
andcurrentOffsets
are collected from Kafka at different times and may be subject to change.Environment Information
Ci uses the following docker images:
maven:3.8.6-eclipse-temurin-17
confluentinc/cp-zookeeper:7.3.1
confluentinc/cp-kafka:7.3.1
Example Application
No response
Version
micronaut-platform:4.3.4
micronaut-kafka:5.3.0
The text was updated successfully, but these errors were encountered: