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

Propagate Medusa process exit code in k8s docker-entrypoint #806

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

c3-clement
Copy link
Contributor

@c3-clement c3-clement commented Sep 18, 2024

Resolve #805

Prior to this change, if the Medusa process exits with a non-zero exit code for some reason, the Medusa container will be stuck forever because of the while true loop.

With this fix, the while loop will be interrupted if the Medusa process exits, and the container will exit with the same code as the Medusa process exit code.

To validate this change, I've manually tested the following scenarios:

  • Start the medusa container without any file at /etc/medusa.ini -> the container should exit with a non-zero code.
  • Start the medusa container with a valid config at /etc/medusa.ini -> the container should run as expected.
  • Change the config /etc/medusa.ini while the container is running -> the container should exit with a zero code.
  • Put an arbitrary sys.exit(42) in server.py to mock a production issue -> the container should exit with the status code 42.

Copy link

sonarcloud bot commented Sep 18, 2024

Copy link
Contributor

@adejanovski adejanovski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the fix @c3-clement !

@adejanovski adejanovski merged commit 9a961b6 into thelastpickle:master Sep 23, 2024
29 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cassandra pod stuck instead of CrashLoopBackOff when Medusa config loading fails
2 participants