Repository navigation
fix: let influxdb, grafana and modbus-serial get SIGTERM (#1680) - #1681
Merged
Merged
Conversation
docker stop sends SIGTERM to PID 1 only. In influxdb and grafana PID 1 was the secure-entrypoint.sh shell, which ran the real entrypoint without exec, so influxd and grafana never got the signal. In modbus-serial PID 1 is node with no handler, and PID 1 ignores a signal it does not handle. Each stop waited out the grace period and then SIGKILLed them. - secure-entrypoint.sh (influxdb, grafana): exec the upstream entrypoint, which itself execs the server, so the server becomes PID 1. - modbus-serial: exit on SIGTERM. - influxdb: stop_grace_period 40s, since influxd allows itself 30 s to stop cleanly.
2 tasks
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #1680.
docker stopsends SIGTERM to PID 1 only. These services never got it, so every stop (deploy or UPS shutdown) waited out the grace period and then SIGKILLed them.Changes
secure-entrypoint.sh:execthe upstream entrypoint. The upstream/entrypoint.sh(influxdb) and/run.sh(grafana) already end withexec, soinfluxdandgrafana serverbecome PID 1. (mqtt-influxalready usedexec.)writeSync, so it loses nothing. Points still in the InfluxDB client batch (up to 60 s) are dropped, same as with the kill today; flushing them on stop would be a separate change.stop_grace_period: 40s. influxd gives itself 30 s to stop cleanly; the compose default of 10 s could still cut it.Proof after deploy
docker topshowsinfluxd/grafana/nodeas PID 1.