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

Q2 unblock hander callback race #1144

Open
kgiusti opened this issue Jun 28, 2023 · 1 comment
Open

Q2 unblock hander callback race #1144

kgiusti opened this issue Jun 28, 2023 · 1 comment
Assignees

Comments

@kgiusti
Copy link
Contributor

kgiusti commented Jun 28, 2023

There is a race in the way Q2 signals that the ingress connection has been unblocked. It is possible that the unblock handler callback runs simultaneously with the deletion of the ingress connection that is being unblocked. This can lead to a crash.

Issue #1134 is an example of this race. Since the TCP adaptor has its own ingress flow control window the fix for #1134 is to simply not use Q2 for TCP. However all the other protocols - including AMQP - are susceptible to this race.

@kgiusti kgiusti self-assigned this Jun 28, 2023
@kgiusti
Copy link
Contributor Author

kgiusti commented Jun 28, 2023

Potential solution: the ingress connection should de-register its Q2 unblock handler prior to the connection being closed. This should happen when the message is marked "receive complete" for example since Q2 will no longer apply at that point.

The de-registering of the handler must be synchronized with the callback of that handler in a way to ensure the callback can never occur after the handler is de-registered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant