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

[Issue 1274][connection] Refactor connection concurrency model #1275

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

Gilthoniel
Copy link
Contributor

@Gilthoniel Gilthoniel commented Aug 29, 2024

Fixes #1274

Motivation

A race can happen while a consumer or a producer is registering itself to the connection to later receive closing notification.

Modifications

This pull request changes the concurrency model of the connection to properly lock the different actors between the closing procedure and the registration of handlers and listeners. After this, a caller will properly check the state of the connection and aborts if closed, and it will be certain that it will not be registered in concurrency with a closing.

Verifying this change

  • Make sure that the change passes the CI checks.

This change is already covered by existing tests.

Does this pull request potentially affect one of the following parts:

none

Documentation

none

@Gilthoniel Gilthoniel force-pushed the feature/connection-concurrency branch from 20c03e2 to f24f7c7 Compare August 29, 2024 08:53
Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, great work @Gilthoniel

@crossoverJie crossoverJie added this to the v0.14.0 milestone Sep 11, 2024
@nodece nodece merged commit 7ae0059 into apache:master Sep 11, 2024
7 checks passed
@frankjkelly
Copy link

@Gilthoniel Thanks for this fix. Was this issue introduced in 0.13.1 or was does it predate that and if so do you know how far back it goes?

CC: @crossoverJie @nodece

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

Successfully merging this pull request may close these issues.

Race during reconnect
5 participants