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

Make storage on server contexts thread safe #1146

Merged
merged 1 commit into from
Mar 10, 2021

Conversation

glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Mar 9, 2021

Motivation:

The properties on the server context passed to user functions aren't
thread safe and require the user to be on the correct event loop to
handle them correctly. That's not obvious nor is it documented.

Modifications:

  • Add a lock to the server context.

Result:

Server context is thread-safe.

@glbrntt glbrntt added the 🔨 semver/patch No public API change. label Mar 9, 2021
@glbrntt glbrntt requested a review from Lukasa March 9, 2021 14:10
Motivation:

The properties on the server context passed to user functions aren't
thread safe and require the user to be on the correct event loop to
handle them correctly. That should be documented!

Modifications:

- More docs
- Shim through computed properties with event-loop assertions

Result:

Better docs.
@glbrntt glbrntt force-pushed the gb-server-context branch from a220c3b to b447780 Compare March 9, 2021 14:56
@glbrntt glbrntt merged commit 38e9288 into grpc:main Mar 10, 2021
@glbrntt glbrntt deleted the gb-server-context branch March 10, 2021 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants