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

bindings: mark Connection as Sync #4467

Merged
merged 5 commits into from
Mar 25, 2024
Merged

bindings: mark Connection as Sync #4467

merged 5 commits into from
Mar 25, 2024

Conversation

lrstewart
Copy link
Contributor

@lrstewart lrstewart commented Mar 21, 2024

Resolved issues:

resolves #4461

Description of changes:

Add Sync to the Connection struct. My code comment should explain why that is correct.

Call-outs:

We have to add Sync to ConnectionFuture and ConfigResolver, which is a breaking change. I couldn't find any uses of ConnectionFuture in public github repos or other public sources, so hopefully that breaking change isn't too painful. Only s2n-quic seems to be using ConfigResolver, and only for examples.

Testing:

New test to match Send test for context

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added the s2n-core team label Mar 21, 2024
@lrstewart lrstewart marked this pull request as ready for review March 21, 2024 23:34
/// Note: Although non-mutating methods like getters should be thread-safe by definition,
/// technically the only thread safety guarantee provided by the underlying C library
/// is that s2n_send and s2n_recv can be called concurrently.
///
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like this PR is a good time to take a whack at #4413

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added, but you may regret that ask because the PR is much larger now :)

Please make sure all my reasoning makes sense. I'm trying to walk a fine line between explaining what Send and Sync mean (NOT what our documentation should do-- there's a lot of Rust documentation specifically on that topic) and not being helpful at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, too much larger. I don't want discussion of the documentation changes to block the Sync fix. I've moved the documentation changes to another PR: #4471

@lrstewart lrstewart merged commit 30a4901 into aws:main Mar 25, 2024
31 checks passed
@lrstewart lrstewart deleted the sync branch March 25, 2024 17:19
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.

[Rust Binding] Making s2n_tls::connection::Connection sync safe
3 participants