-
Notifications
You must be signed in to change notification settings - Fork 137
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
ConcurrentModificationException in the release effect #1238
Comments
Hi @TobiasPfeifer. Thanks for the bug report. The problem is that the consumer is still in use when the release effect (closing the underlying java consumer) is executed. My guess is that during shutdown, the task that is using the consumer is not interrupted. There is some funky code in |
It's not that funky, it just forks it so it can interrupt it by calling I agree with your idea that something is still using the consumer at the time when @TobiasPfeifer Could you share some code that generates this error? |
Maybe this is due to |
Nope, ignore that, the final command is |
All access from zio-kafka's
Since we haven't seen this issue occur ourselves, we don't know which version this occurred with and how it can be reproduced, I propose we close this issue. Should this occur for anyone at a later time or should more details pop up, it can of course be reopened. |
Observed another one in tests for #1201 (see https://github.com/zio/zio-kafka/actions/runs/11755707706/job/32751057919?pr=1201):
Still no clue what is causing that. The call to It's fixed by this: 5ef97ef |
It's not at all unlikely that there is some race condition inside the apache kafka consumer itself.. |
Indeed. Wouldn't surprise me anymore. It would explain spurious |
Okay I was wrong there. There is a third exception: the |
It seems that the
KafkaConsumer
must be closed from the same thread which is not guaranteed with ZIO.acquireRelease AFAIKI´m providing the layers like this:
The text was updated successfully, but these errors were encountered: