Enable signal handlers per default for LocalStack inside a docker container#6000
Merged
Enable signal handlers per default for LocalStack inside a docker container#6000
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
Member
Author
|
I have read the CLA Document and I hereby sign the CLA |
localstack-bot
added a commit
that referenced
this pull request
May 3, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Currently, passing signals from the LS docker container init process (= docker-entrypoint.sh) to supervisord (which will in turn pass it to the LocalStack process itself), is disabled per default, unless you set
SET_TERM_HANDLER=1.This results in long shutdown times for docker-compose, as well as leftover containers started by LS (like lambda containers etc.), since docker-compose will kill containers after 10s if they do not end themselves in that timeframe.
This behavior is not seen in LS CLI, since we set the term handler variable explicitely there.
This PR inverts this behavior, signal handling is enabled per default, unless
DISABLE_TERM_HANDLER=1is set, for users who, for any reason, would like to use the "old" behavior.The
SET_TERM_HANDLERvariable setting in CLI is still in there for now, in order to prevent bricking instances where a new CLI meets an older docker image (should be removed after a considerate amount of time).This PR results in way faster stop times in docker-compose (<2s instead of >10s), as well as a possible cleanup of resources, and possibilities for persistence.