Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 11631

bottle / gunicorn not responding to SIGTERM after ANY request

$
0
0

I have used bottle for a long time and never run into this before, but recently I started a new project and encountered some strange behaviour that I just can not track down at all.

If I start a bottle instance in my script, and send that script a SIGTERM it immediately shuts down gracefully. But if I make even a single http request any future sending of SIGTERM is shown on the screen [INFO] Handling signal: term but the script doesn't shut down.

I was convinced at first this was my mistake somehow, that I wasn't exiting properly from my requests, but it turns out even a 404 request, or a 405, trigger the same behaviour.

import bottlebottle.run(host = '0.0.0.0', port = 9000, server = 'gunicorn')

If I run this, then send SIGTERM, no problem, script exists. If I request a page and get a 404, that's it, no more response to SIGTERM except the message saying it got the signal, but it doesn't shut down after that.

The host and port don't make any difference. Nor does adding successful requests. The only thing that seems to trigger the behaviour is the server = 'gunicorn' line. If I remove this, then the script acts as expected.

I'm at my wit's end with this. I kept removing more and more code trying to understand what the problem was, until I ended up with the above, and that's all it takes. Issue has to be between bottle and gunicorn somehow.

bottle is 0.12.25gunicorn is 21.2.0python is 3.10.12


Viewing all articles
Browse latest Browse all 11631

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>