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

Use write lock for memory store filtered state #4498

Merged
merged 1 commit into from Sep 7, 2023

Conversation

neilalexander
Copy link
Member

Calls to filteredStateLocked can mutate the per-subject state by recalculating the first sequences. Doing so under a read-only lock can lead to race conditions, so switch the call sites out to write locks instead.

Signed-off-by: Neil Twigg neil@nats.io

Signed-off-by: Neil Twigg <neil@nats.io>
@neilalexander neilalexander marked this pull request as ready for review September 7, 2023 12:15
@neilalexander neilalexander requested a review from a team as a code owner September 7, 2023 12:15
Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

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

LGTM

@neilalexander neilalexander merged commit 6332512 into dev Sep 7, 2023
2 checks passed
@neilalexander neilalexander deleted the neil/memfilteredstate branch September 7, 2023 15:26
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.

None yet

2 participants