supercronic icon indicating copy to clipboard operation
supercronic copied to clipboard

Graceful stopping fails with prometheus enabled

Open clushie opened this issue 1 year ago • 0 comments

If I'm running supercronic with prometheus active, sending SIGINT or SIGTERM results in an exit code of 1 and the log message "prometheus http serve failed".

supercronic -json -prometheus-listen-address 0.0.0.0 /config/cronfile &
sleep 1s
kill -SIGINT %1
# {"level":"info","msg":"received interrupt, shutting down","time":"2024-10-08T08:17:55Z"}
# {"level":"info","msg":"waiting for jobs to finish","time":"2024-10-08T08:17:55Z"}
# {"level":"info","msg":"exiting","time":"2024-10-08T08:17:55Z"}
# {"level":"fatal","msg":"prometheus http serve failed: http: Server closed","time":"2024-10-08T08:17:55Z"}
# [1]+  Exit 1                  supercronic -json -prometheus-listen-address 0.0.0.0 -json /config/cronfile

without prometheus, the stopping becomes graceful again:

supercronic -json /config/cronfile &
sleep 1s
kill -SIGINT %1
# {"level":"info","msg":"read crontab: /config/cronfile","time":"2024-10-08T08:20:28Z"}
# {"level":"info","msg":"received interrupt, shutting down","time":"2024-10-08T08:20:29Z"}
# {"level":"info","msg":"waiting for jobs to finish","time":"2024-10-08T08:20:29Z"}
# {"level":"info","msg":"exiting","time":"2024-10-08T08:20:29Z"}
# [1]+  Done                    supercronic -json /config/cronfile

Note, without prometheus the /health endpoint is also missing

clushie avatar Oct 08 '24 08:10 clushie