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

fix: use compose stop/rm for forceful termination of stubborn containers #203

Conversation

austinvazquez
Copy link
Member

@austinvazquez austinvazquez commented Dec 26, 2024

Issue #, if available:
#202

Description of changes:
This change refactors compose logs and compose kill test suites to use
compose stop/rm for cleanup. Starting in nerdctl 2.0, compose down
attempts to gracefully teardown containers before sending forceful kill
signal after a 10 second timeout. For developer experience, this is
acceptable, but in automation it does not work well. Compose stop/rm is
more preferable for stubborn containers like sleep infinity.

Testing done:
Ran test in runfinch/finch-core#472

  • I've reviewed the guidance in CONTRIBUTING.md

License Acceptance

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@austinvazquez
Copy link
Member Author

Running this test in runfinch/finch-core#472; it looks like compose down is still hanging. Putting this in draft while I investigate further.

@austinvazquez austinvazquez marked this pull request as draft December 26, 2024 05:02
@austinvazquez
Copy link
Member Author

austinvazquez commented Dec 26, 2024

There appears to be behavior differences here to account for. Previously compose down would remove the containers pretty forcibly; now it attempts a more graceful shutdown. The challenge is the containers we are using to test are stubborn. i.e. echo ... && sleep infinity

Meaning compose down is sending the signal and hitting the timeout on each teardown. I am going to rework this PR to appropriately handle compose testing teardown.

@austinvazquez austinvazquez force-pushed the extend-timeout-for-compose-down branch from 44f192b to b340dfc Compare December 26, 2024 18:09
This change refactors compose logs and compose kill test suites to use
compose stop/rm for cleanup. Starting in nerdctl 2.0, compose down
attempts to gracefully teardown containers before sending forceful kill
signal after a 10 second timeout. For developer experience, this is
acceptable, but in automation it does not work well. Compose stop/rm is
more preferable for stubborn containers like sleep infinity.

Signed-off-by: Austin Vazquez <[email protected]>
@austinvazquez austinvazquez force-pushed the extend-timeout-for-compose-down branch from b340dfc to e70dd44 Compare December 26, 2024 18:29
@austinvazquez austinvazquez changed the title feat: extend compose down timeout limit to 20 seconds fix: use compose stop/rm for forceful termination of stubborn containers Dec 26, 2024
@austinvazquez austinvazquez marked this pull request as ready for review December 26, 2024 18:59
@austinvazquez
Copy link
Member Author

Superseded by #208

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.

2 participants