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

Bot not receiving termination signals #62

Open
Trimatix opened this issue Apr 14, 2021 · 4 comments
Open

Bot not receiving termination signals #62

Trimatix opened this issue Apr 14, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@Trimatix
Copy link
Contributor

Trimatix commented Apr 14, 2021

When run outside of docker, SIGINT/SIGTERM appear to work fine. Otherwise, the bot is killed but does not appear to have received the signal.

@Trimatix Trimatix added the bug Something isn't working label Apr 14, 2021
@Laura7089
Copy link
Member

Laura7089 commented May 31, 2021

Could be related to this: https://stackoverflow.com/questions/62853875/stopping-python-container-is-slow-sigterm-not-passed-to-python-process. If that's the problem, we can bake tini into the docker container and/or add init: true to the docker-compose file.

@Trimatix
Copy link
Contributor Author

If that's the problem, we can bake tini into the docker container and/or add init: true to the docker-compose file.

Sadly our issue is different, I have a similar python script set up to detect sigint but it prints nothing
I've also already tried using init: true but no dice :(

@Laura7089 Laura7089 self-assigned this May 31, 2021
@Laura7089
Copy link
Member

Laura7089 commented Jun 2, 2021

Okay, I've tinkered a bit:

  • Running with tini inside the container or the init: true param in compose doesn't solve the issue
  • We're using a direct call in the docker exec form so that isn't the issue
  • Adding more explicit debug print statements inside handlers and the handler register function shows that the handlers are registered seemingly without issue but the handlers are never called - I've tried creating a marker file as well in case the logs aren't being caught by docker but no beans
  • Running the container with entrypoint sleep 99999, then docker-compose exec bot bash and manually running python main.py and issuing ctrl-C directly also doesn't work

@Laura7089
Copy link
Member

Laura7089 commented Jun 2, 2021

When run outside of docker, it SIGINT/SIGTERM appear to work fine.

I'm actually unable to replicate this - it doesn't outside of docker either. Could this be because the handlers are registered in a module that isn't the calling one?

@Laura7089 Laura7089 removed their assignment Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants