You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/09/02 14:56:54 UTC

[GitHub] [incubator-superset] smacker opened a new pull request #8156: Forward SIGTERM signal to gunicorn

smacker opened a new pull request #8156: Forward SIGTERM signal to gunicorn
URL: https://github.com/apache/incubator-superset/pull/8156
 
 
   ### CATEGORY
   
   Choose one
   
   - [x] Bug Fix
   - [ ] Enhancement (new features, refinement)
   - [ ] Refactor
   - [ ] Add tests
   - [ ] Build / Development Environment
   - [ ] Documentation
   
   ### SUMMARY
   
   Currently docker entrypoint is a bash script.
   `docker stop` command (or restart in kubernetes) sends SIGTERM to the
   container but it isn't catched by gunicorn.
   So gunicorn can't start graceful shutdown which may lead to killing
   user's connection and also adds 10s (default value) delay for stopping
   until docker sends SIGKILL.
   Using `exec` replaces the shell with the process being opened and
   signals are propagated correctly.
   
   Ref: https://docs.docker.com/engine/reference/commandline/stop/
   Ref: https://unix.stackexchange.com/questions/146756/forward-sigterm-to-child-in-bash
   
   ### TEST PLAN
   
   Run superset in docker container and execute `docker stop` on master it would result in:
   1. 10s delay before stopping
   2. Exit code 137 (means gunicorn was killed)
   
   Run superset in docker container and execute `docker stop` from this branch it would result in: 
   1. Quick exit (~1s)
   2. Correct exit code 0
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   ### REVIEWERS
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org