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 Server Exit Null Reference Exception #747

Merged
merged 3 commits into from
Oct 24, 2024

Conversation

hamdaankhalid
Copy link
Contributor

@hamdaankhalid hamdaankhalid commented Oct 24, 2024

StoreWrapper is created in GarnetServer and then shared across all instances of RespServerSessions that get created by the provider. The RespServerSessions run in separate threads. During the creation of the provider we also pass into the

When we start Disposal logic of GarnetServer. The disposal of the provider also triggers the disposal of the storeWrapper, which is going to change the value of "metrics" in GarnetServer to null.

Now the data race in my head is going to be from the fact that metrics is changed by a thread without synchronization with resp server sessions running in separate threads. Instead of synchronization we could let the null check remain as a guard against seeing Exceptions being thrown in disposal of RespServerSession.

This only started happening because we started pooling histograms.

This PR makes changes to add graceful exiting instead of the null refs.

@hamdaankhalid hamdaankhalid changed the title Fix Server Exit Null Reference Exception BugFix Server Exit Null Reference Exception Oct 24, 2024
@hamdaankhalid hamdaankhalid changed the title BugFix Server Exit Null Reference Exception Fix Server Exit Null Reference Exception Oct 24, 2024
@TalZaccai TalZaccai merged commit 5a0aa99 into microsoft:main Oct 24, 2024
15 checks passed
@hamdaankhalid hamdaankhalid deleted the hamdaankhalid/disposal-bugfix branch October 25, 2024 01:35
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.

4 participants