Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve uWSGI and consul-template interactions on reloading #2640

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/services/api_compat/consul-template-api-compat.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ template {
}

exec {
command = "run-lb-command uwsgi --die-on-term /etc/uwsgi/uwsgi-api-compat.ini"
command = ["run-lb-command", "uwsgi", "/etc/uwsgi/uwsgi-api-compat.ini"]
splay = "5s"
reload_signal = "SIGHUP"
kill_signal = "SIGTERM"
Expand Down
3 changes: 1 addition & 2 deletions docker/services/api_compat/uwsgi-api-compat.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ log-x-forwarded-for=true
disable-logging = 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
die-on-term = true
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ template {
}

exec {
command = "run-lb-command python3 -u -m listenbrainz.metadata_cache.apple.runner"
command = ["run-lb-command", "python3", "-u", "-m", "listenbrainz.metadata_cache.apple.runner"]
splay = "60s"
reload_signal = "SIGHUP"
kill_signal = "SIGTERM"
Expand Down
2 changes: 1 addition & 1 deletion docker/services/labs_api/consul-template-labs-api.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ template {
}

exec {
command = "run-lb-command uwsgi --die-on-term /etc/uwsgi/uwsgi-labs-api.ini"
command = ["run-lb-command", "uwsgi", "/etc/uwsgi/uwsgi-labs-api.ini"]
splay = "5s"
reload_signal = "SIGHUP"
kill_signal = "SIGTERM"
Expand Down
3 changes: 1 addition & 2 deletions docker/services/labs_api/uwsgi-labs-api.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ log-x-forwarded-for=true
disable-logging = 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
; increase buffer size for requests that send a lot of mbids in query params
buffer-size = 8192
die-on-term = true
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ template {
}

exec {
command = "run-lb-command python3 -u -m listenbrainz.mbid_mapping_writer.mbid_mapping_writer"
command = ["run-lb-command", "python3", "-u", "-m", "listenbrainz.mbid_mapping_writer.mbid_mapping_writer"]
splay = "60s"
reload_signal = "SIGHUP"
kill_signal = "SIGTERM"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ template {
}

exec {
command = "run-lb-command python3 -m listenbrainz.spark.spark_reader"
command = ["run-lb-command", "python3", "-m", "listenbrainz.spark.spark_reader"]
splay = "5s"
reload_signal = "SIGHUP"
kill_signal = "SIGTERM"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ template {
}

exec {
command = "run-lb-command python3 -u -m listenbrainz.metadata_cache.spotify.runner"
command = ["run-lb-command", "python3", "-u", "-m", "listenbrainz.metadata_cache.spotify.runner"]
splay = "60s"
reload_signal = "SIGHUP"
kill_signal = "SIGTERM"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ template {
}

exec {
command = "run-lb-command python3 -m listenbrainz.spotify_updater.spotify_read_listens"
command = ["run-lb-command", "python3", "-m", "listenbrainz.spotify_updater.spotify_read_listens"]
splay = "5s"
reload_signal = "SIGHUP"
kill_signal = "SIGTERM"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ template {
}

exec {
command = "run-lb-command python3 -u -m listenbrainz.timescale_writer.timescale_writer"
command = ["run-lb-command", "python3", "-u", "-m", "listenbrainz.timescale_writer.timescale_writer"]
splay = "5s"
reload_signal = "SIGHUP"
kill_signal = "SIGTERM"
Expand Down
2 changes: 1 addition & 1 deletion docker/services/uwsgi/consul-template-uwsgi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ template {
}

exec {
command = "run-lb-command uwsgi --die-on-term /etc/uwsgi/uwsgi.ini"
command = ["run-lb-command", "uwsgi", "/etc/uwsgi/uwsgi.ini"]
splay = "5s"
reload_signal = "SIGHUP"
kill_signal = "SIGTERM"
Expand Down
3 changes: 1 addition & 2 deletions docker/services/uwsgi/uwsgi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ log-x-forwarded-for=true
disable-logging = 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
; increase buffer size for requests that send a lot of mbids in query params
buffer-size = 8192
die-on-term = true
2 changes: 1 addition & 1 deletion docker/services/websockets/consul-template-websockets.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ template {
}

exec {
command = "run-lb-command python3 manage.py run_websockets -h 0.0.0.0 -p 3031"
command = ["run-lb-command", "python3", "manage.py", "run_websockets", "-h", "0.0.0.0", "-p", "3031"]
splay = "5s"
reload_signal = "SIGHUP"
kill_signal = "SIGTERM"
Expand Down