-
Notifications
You must be signed in to change notification settings - Fork 142
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
Abrupt shutdown not properly handled #727
Comments
Hi 👋 Have you tried But in general it's known issue and will be covered with #577 (which is high-priority task for us, but any contributions are welcome) |
No idea it existed, how do I used it? |
Just enable the feature for |
I’m going to close this issue as is known and should be solved by #577 |
Hmm interesting, it worked. Curious how this is different from what I have. I thought that |
I guess you answered in the wrong issue. No, drop isn't called for static variables. See my answer in the relevant issue and check the conversations in other similar ones |
Run a container through this crate and abruptly shut it down with something like ctrl+c, and the containers would still be running. This leaves docker in an invalid state and either have consequences on subsequent runs or leaves a bunch of dangling containers.
Personally for me, a huge pain of testing with docker is state management. If I programmatically spin up docker containers via invoked system commands, I have to manage its state, figure out if it's actually started, free the ports, shut it down etc. This is just all not worth it for me.
The cornucopia crate, for example, uses the postgres docker to validate SQL schemas and generate sql queries at compile time, and it does this via docker containers created via
std::process
commands, and its auto-build feature is literally broken right now because it doesn't fully manage the state of the docker containers it created.testcontainers
solves a huge part of this problem for me but I was disappointed to see that it didn't shutdown the containers when w/e program abruptly stopped. It would be really nice if it could at least do a best effort try when this happened :)The text was updated successfully, but these errors were encountered: