Skip to content

Commit

Permalink
Fix uWSGI configuration for clean shutdown
Browse files Browse the repository at this point in the history
In absence of the exit-on-reload configuration option, uWSGI does not
exit cleanly when consul-template attempts to restart it. This manifests
as an error like: `bind(): Address already in use [core/socket.c line 769]`.
Fix the configuration appropriately.
  • Loading branch information
amCap1712 committed Nov 21, 2023
1 parent c632ecf commit 3d19c40
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docker/prod/uwsgi.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[uwsgi]
uid = www-data
gid = www-data
master = true
http = 0.0.0.0:8080
module = artwork_redirect.wsgi
Expand All @@ -9,3 +11,8 @@ processes = 10
die-on-term = true
worker-reload-mercy = 10
reload-mercy = 25
log-x-forwarded-for=true
; quit uwsgi if the python app fails to load
need-app = true
; when uwsgi gets a sighup, quit completely and let runit restart us
exit-on-reload = true

0 comments on commit 3d19c40

Please sign in to comment.