anax
anax copied to clipboard
Add signal handling to agbot_start.sh and css_start.sh
Description
When run in a container anax is run via a shell script that does not handle SIGTERM and hence when the container is stopped this signal does not arrive to the binary for graceful exit. A consequence of this is when run via docker compose up, docker compose down will have to wait until the timeout in order to kill the process.
The same happens for the ccs-api.
This change adds proper SIGTERM handling to agbot_start.sh and css_start.sh.
Type of change
Please delete options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
How Has This Been Tested?
Running the container image with docker compose up and checking the output of docker compose down:
Running docker compose down -t 20s
without this change :
✔ Container agbot Removed 21.9s
✔ Container css-api Removed 20.4s
With this change:
✔ Container agbot Removed 3.4s
✔ Container css-api Removed 4.2s
Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
- [x] I have checked my code and corrected any misspellings
- [ ] I have tagged the reviewers in a comment below incase my pull request is ready for a review
- [x] I have signed the commit message to agree to Developer Certificate of Origin (DCO) (to certify that you wrote or otherwise have the right to submit your contribution to the project.) by adding "--signoff" to my git commit command.
Not sure why the ci failed, any hint with that would be appreciated
Hi @LiilyZhang is anything preventing this to be merge I should address?
we are still investigating how to test this in openshift environment @lbergesio
we are still investigating how to test this in openshift environment @lbergesio
I think kubelet works with the pod the same way than docker with the container: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination I would say just run the pod, get in, check the process is running. Destroy the pod, this will send sigterm to the pod process?
Hi! any update on this? Thanks