Skip to content

Conversation

jadenPete
Copy link

The directories we were creating weren't random, so it was possible tha two Node actions could share the same directory and one could delete it before the other.

Also, when catching process events like uncaughtException and signal events, we need explicitly stop the process (and make sure we return the correct code). In the case of uncaughtException, we also need to handle the error thrown in the same way Node.js would've. Doing clean up work seems to be an very difficult problem in Node (hence the existence of https://github.com/nodejs/node/issues/20804), so I've decided to just catch exit for the time being. Sure, we may leak temporary directories if a certain signal is sent, but I think the risk of not handling signals correctly outweighs the risk of leaking temporary directories.

@jjudd
Copy link

jjudd commented Sep 3, 2025

Been reviewing this offline with Jaden.

The directories we were creating weren't random, so it was possible tha
two Node actions could share the same directory and one could delete it
before the other.

Also, when catching process events like `uncaughtException` and
signal events, we need explicitly stop the process (and make sure we
return the correct code). In the case of `uncaughtException`, we also
need to handle the error thrown in the same way Node.js would've. Doing
clean up work seems to be an very difficult problem in Node (hence the
existence of `https://github.com/nodejs/node/issues/20804`), so I've
decided to just catch `exit` for the time being. Sure, we may leak
temporary directories if a certain signal is sent, but I think the risk
of not handling signals correctly outweighs the risk of leaking
temporary directories.
@jadenPete jadenPete force-pushed the jpeterson-fix-temporary-directory-creation branch from 9988816 to dd3613c Compare September 4, 2025 15:58
@jjudd jjudd merged commit 4e59a79 into lucid Sep 5, 2025
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.

2 participants