POC of swapping graceful shutdown to SIGTERM #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Swaps graceful shutdown behavior of nginx in our buildpack to SIGTERM.
Graceful shutdown becomes SIGTERM
Fast shutdown becomes SIGCONT, as a bogus signal
Testing:
Not done yet, 2 options:
Create a test app on heroku
Run the binary the buildpack build outputs.
The artifact is an ELF
But not compatible w/ BSD/OSX :(
I think we could start a docker container of cedar-14 and run the ELF from there, but probably easier to just make a dummy heroku app?
Notes:
I picked SIGCONT (continue stopped process) as the new signal for "fast shutdown", defined macros for signal resolution meant I couldn't just give a bogus/unused signal like
9000without having a SIGNINETHOUSAND def.I don't think this will cause issues, and felt better than having QUIT do something unexpected if Heroku ever starts sending QUIT.
I only did this for cedar-14, would want to make sure this is good for heroku 16/18 if we do this in the future
It took longer to write these notes than to make the actual POC, it's not great we'd have to potentially do something here as we upgrade stacks, but feel like right now a stack upgrade is probably non-trivial.
The output of the relevant part of the build is: