-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Potential race/deadlock between broker error and AsyncClose
#475
Comments
Your sequence of events seems plausible to me. Maybe things like this will be a lot easier to reason about using a |
? the problem is that multiple things can legitimately write to |
Why would we ever want to write more than once to |
Never mind; we're not just |
In the case when the user calls `AsyncClose` at the same instant as the broker leading the partition returns an error. Fixes bug #475.
I was inspecting the consumer code as part of #474 and I realized that there is a potential deadlock condition in the very rare case where a broker returns an error (such as
ErrOffsetOutOfRange
) at the same time that the user callsAsyncClose
(or justClose
).Both events result in a value being written to
child.dying
which has a buffer for only one event. If theAsyncClose
write succeeds, then theresponseFeeder
write (triggered by the broker error) will block; since the goroutine responsible for reading from that channel is currently waiting onresponseFeeder
to unblock it, I believe this deadlocks.cc @Shopify/kafka very unlikely (and entirely theoretical at this point) but I'd appreciate if somebody could verify my logic
The text was updated successfully, but these errors were encountered: