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

Safer cleanup on SIGTERM #366

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Safer cleanup on SIGTERM #366

wants to merge 6 commits into from

Conversation

lionel-
Copy link
Member

@lionel- lionel- commented Apr 25, 2023

This makes the SIGTERM handler safer because system() is not safe to call from a signal handler (see https://sourceware.org/bugzilla/show_bug.cgi?id=4737). To avoid doing too much work in the handler, we prepare a cleanup process ahead of time that we can trigger from the SIGTERM handler with an async-safe one-byte write.

I'm a bit uneasy about calling rm -rf on an envvar though. Should we use the previous approach of querying tempdir() to create an rm -rf command ahead of time?

@lionel- lionel- mentioned this pull request Apr 27, 2023
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.

1 participant