Skip to content

Conversation

ThomasCrambert
Copy link
Contributor

Expose new on_exit hook to allow post-shutdown cleanup actions.

Notes:

  • I made it for all kind of processes, but I believe it would only be useful for workers as they are the only one that may require such hooks. Do you believe it should only be for workers now and add them for the others later?
  • Dispatchers currently trigger run_stop_hooks in after_shutdown but workers trigger them at before_shutdown, I changed it in this PR but was that the expected behavior?

@ThomasCrambert ThomasCrambert force-pushed the ThomasCrambert/add-before-exit-hook branch from fdd4f44 to c23f56f Compare January 29, 2025 13:23
@ThomasCrambert ThomasCrambert force-pushed the ThomasCrambert/add-before-exit-hook branch from c23f56f to 037ce56 Compare January 29, 2025 13:28
@rosa
Copy link
Member

rosa commented Feb 3, 2025

Thanks @ThomasCrambert!

Dispatchers currently trigger run_stop_hooks in after_shutdown but workers trigger them at before_shutdown, I changed it in this PR but was that the expected behavior?

Oh! No, that was an oversight. Thanks for catching that 🙏

@rosa
Copy link
Member

rosa commented Feb 3, 2025

Do you believe it should only be for workers now and add them for the others later?

No, I think this is fine 👍

@rosa rosa merged commit 9cd6bc3 into rails:main Feb 3, 2025
34 checks passed
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