Refactor exec of child process to trap, spawn, signal, and wait pattern #823
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.
🗣 Description
This PR changes the way the child processes are managed by the entrypoint script.
Specifically it backs out some of the changes from #822
Instead of
exec
ing thelauncher.sh
it will now be spawned into the background and waited on.TERM
signals will be trapped and forwarded to the child while waiting.This allows the DDOS bucket protection code to execute if needed.
It also reduces the sleep interval in the infinite loop to allow container shutdown to be more responsive
when sleeping.
See:
Closes #813
💭 Motivation and context
I realized that the DDOS protection in the entrypoint would not execute after the
exec
call.I expect that there are deployments that have disabled caching that may still need this mitigation.
🧪 Testing
I tested locally that the signals are properly handled by the child processes.
I disable the
CONTAINER_CACHE
and killed thenode
process to verify that the entrypoint wouldexecute the infinite sleep.
Also CI.
✅ Pre-approval checklist
to reflect the changes in this PR.