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

Add exit call to kill command #202

Conversation

MattyTheHacker
Copy link
Member

No description provided.

@CarrotManMatt
Copy link
Member

CarrotManMatt commented May 9, 2024

Do you have a link to the documentation that shows that exiting with exit code 0 will tell docker not to do a restart?

@CarrotManMatt CarrotManMatt added bug Something isn't working deployment Changes to the deployment or CI/CD configuration labels May 9, 2024
@MattyTheHacker
Copy link
Member Author

Do you have a link to the documentation that shows that exiting with exit code 0 will tell docker not to do a restart?

nah - but we're set to "Always" which says that if it's manually shut down it won't attempt to restart. The "on-failure" config option says it considers an error to be a non-zero exit code so assumed 🤷 don't ask me shit like this as if I have any idea what I'm doing lmfao /lh

fwiw: https://docs.docker.com/config/containers/start-containers-automatically/

@CarrotManMatt
Copy link
Member

Cheers, that's the correct link. Yh it's a shame the config options for restart policies aren't perfect. Using on-failure would be useful as it would seem to solve the problem, except for the fact that it won't restart if the docker Daemon goes down.

@CarrotManMatt
Copy link
Member

Although considering the likelihoods of TeX-Bot dieing Vs the hetzner server dieing I think one is much more likely than the other, so maybe changing the docker restart policy on all deployments to be on_failure would be a good idea.

cogs/kill.py Show resolved Hide resolved
…igure-kill-command-to-use-the-correct-exit-code-so-that-it-is-not-restarted-by-dockers-restart-policy
CarrotManMatt
CarrotManMatt previously approved these changes May 11, 2024
@CarrotManMatt
Copy link
Member

Merging this PR will require any deployments to have their docker restart policy set to on-failure.

…t-exit-code-so-that-it-is-not-restarted-by-dockers-restart-policy
@MattyTheHacker
Copy link
Member Author

image

Appears to be intended functionality - but just as an fyi

@CarrotManMatt CarrotManMatt merged commit b157c41 into main May 11, 2024
8 checks passed
@CarrotManMatt CarrotManMatt deleted the 199-configure-kill-command-to-use-the-correct-exit-code-so-that-it-is-not-restarted-by-dockers-restart-policy branch May 11, 2024 22:16
@CarrotManMatt
Copy link
Member

image

Appears to be intended functionality - but just as an fyi

Yh I spent ages trying to figure out why that was suddenly appearing. I'm certain it is from py-cord internals not shutting down correctly, so cannot be helped by us. It is still peculiar that it has only just started to occur though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working deployment Changes to the deployment or CI/CD configuration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configure /kill command to use the correct exit code so that it is not restarted by docker's restart policy
3 participants