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

fix(metrics): fix race condition when calling Broker.Open() twice #2428

Merged
merged 1 commit into from
Jan 26, 2023

Conversation

vincentbernat
Copy link
Contributor

On failure, Broker.Open() can be called several times while a producer is running. In #2409, it was assumed that AsyncProduce can only be called with an open broker, however, it should be read that a user should call it after opening the broker. The broker could be disconnected and in progress of being reconnected. This is not hard to fix as we already have a lock protecting the creation of the registry: just don't create a new metric registry when attempting to reopen the broker.

Fix #2320 (again)

On failure, `Broker.Open()` can be called several times while a producer
is running. In IBM#2409, it was assumed that AsyncProduce can only be
called with an open broker, however, it should be read that a user
should call it after opening the broker. The broker could be
disconnected and in progress of being reconnected. This is not hard to
fix as we already have a lock protecting the creation of the registry:
just don't create a new metric registry when attempting to reopen the
broker.

Fix IBM#2320 (again)
@dnwe
Copy link
Collaborator

dnwe commented Jan 26, 2023

Thanks!

@dnwe dnwe merged commit 0b15695 into IBM:main Jan 26, 2023
@dnwe dnwe added the fix label Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data race in broker v1.36.0
2 participants