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.
When the container receives a signal, we manually forward those signals to child processes with a bit of bash
trap
logic.(Only SIGINT and SIGTERM... other signals are ignored)
This is a bit hacky, and really requires that we know what we're doing.
This change replaces that bash hackery with a proper 🧐 process supervisor, tini.
Full explanation in
doc/process-management.md
-- that's probably the best place to start looking at this PR.testing
recommended that we do a full test with a couple of our containers in heroku before merging this. but to test locally:
in one terminal, build and start your container:
in another terminal, attach to the running container and start sending signals to various processes to see what happens:
if you try to kill the
bash
process, nothing will happen. but if you killpython3
,tini
, orsigsci-agent
, then the container should exit.alternatively, instead of
docker exec
, you can try stopping the container:docker stop "$(docker container ls --latest --quiet)" --time 999
if the above command stops the container immediately, then you know it works. if it stops only after 999 seconds, then there's a problem.