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

feat: Adds cleanup_final #4853

Merged
merged 6 commits into from
Oct 25, 2024
Merged

feat: Adds cleanup_final #4853

merged 6 commits into from
Oct 25, 2024

Conversation

maddeleine
Copy link
Contributor

@maddeleine maddeleine commented Oct 18, 2024

Resolved issues:

N/A

Description of changes:

Adds the s2n_cleanup_final() function to our API list. This is the counterpart to s2n_cleanup_thread. You can see that if I cherry-pick this API in this PR it passes our CI (except for our flaky tests and current known CI failures): #4846. The only test it does not pass is build_aws_crt_cpp.sh. This is the CRT's test suite and they need to use s2n_cleanup_final API in those tests first.

Call-outs:

I don't see any reason why we would make this API unstable. There is no reason why we would delete it once we have it. 😢

Testing:

Includes unit test.

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

api/s2n.h Outdated
Comment on lines 247 to 248
* The difference between this API and s2n_cleanup is that s2n_cleanup may not fully clean up
* the library if it is called on a thread that did not initialize s2n-tls.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure it's clear when this API should be used vs s2n_cleanup. It sounds like this API should maybe always be used instead of s2n_cleanup? If so, should we say something in s2n_cleanup to use this instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Basically, s2n_cleanup_final doesn't really have a usecase unless you disable the atexit handler. If the atexit handler is on, you don't need cleanup_final. And we are planning on turning off the atexit handler soon, just not in this specific PR. I just don't want to write docs that I'm going to have to rewrite in this PR #4846.

@maddeleine maddeleine requested a review from goatgoose October 23, 2024 17:43
@maddeleine maddeleine enabled auto-merge (squash) October 24, 2024 21:33
@dougch dougch disabled auto-merge October 25, 2024 18:28
@dougch dougch enabled auto-merge (squash) October 25, 2024 18:28
@dougch dougch disabled auto-merge October 25, 2024 18:52
@dougch dougch merged commit 9819ac0 into main Oct 25, 2024
37 of 39 checks passed
@dougch dougch deleted the cleanup_final branch October 25, 2024 18:52
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.

4 participants