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

Deprecate encoded connections #1674

Merged
merged 4 commits into from
Jul 23, 2024
Merged

Deprecate encoded connections #1674

merged 4 commits into from
Jul 23, 2024

Conversation

piotrpio
Copy link
Collaborator

Addresses nats-io/nats-architecture-and-design#291

Signed-off-by: Piotr Piotrowski piotr@synadia.com

This fixes an issue where a deadlock could occur when calling `Stop()` or
`Drain()` on `ConsumeContext` or `MessagesContext` and then calling `Consume` or
`Messages` immediately.
Switched to using a type-safe implementation of `sync.Map` for subscriptions map
instead of locking the whole consumer state.
Additionally, changed the type of atomic flags from `uint32` to `atomic.UInt32`
to avoid acciental non-atomic reads/writes.

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
@piotrpio piotrpio requested a review from Jarema July 15, 2024 12:23
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

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

LGTM!

@piotrpio piotrpio merged commit 94fa0cb into main Jul 23, 2024
2 checks passed
@piotrpio piotrpio deleted the encoded-conn-deprecation branch July 23, 2024 14:46
@piotrpio piotrpio mentioned this pull request Aug 13, 2024
piotrpio added a commit that referenced this pull request Aug 15, 2024
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
piotrpio added a commit that referenced this pull request Aug 15, 2024
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
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.

2 participants