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

Adds numerous bug fixes for remote cross. #922

Merged
merged 1 commit into from
Jul 8, 2022

Conversation

Alexhuszagh
Copy link
Contributor

Adds simpler container and volume cleanup, and avoiding keeping anonymous volumes for /cargo/bin present after the container exited. It also ensures containers are stopped even if a signal is sent to the cross command (except SIGKILL), and ensures that containers exit quicker if possible. This is done by using the presence of a TTY, and if it is present, running the default entrypoint, which responds to signals. If we do not have a TTY, the image will not respond to signals, so we send the container a SIGKILL via docker stop using a an instant timeout (0).

This also fixes an issue with stale fingerprint data: if a persistent data volume was deleted and then recreated, previously the project data would not be copied over. This meant that the project could not be found, and it would require users to manually delete the fingerprint data or use single-used volumes.

This also checks if the container has been scheduled for deletion (the drop may not have completed), and errors out early if more calls are made to the container.

This also properly handles docker rm calls if the docker stop command worked without needing a SIGKILL: it silences the output of the error if the container wasn't found.

Adds simpler container and volume cleanup, and avoiding keeping anonymous volumes for `/cargo/bin` present after the container exited. It also ensures containers are stopped even if a signal is sent to the `cross` command (except `SIGKILL`), and ensures that containers exit quicker if possible. This is done by using the presence of a TTY, and if it is present, running the default entrypoint, which responds to signals. If we do not have a TTY, the image will not respond to signals, so we send the container a `SIGKILL` via `docker stop` using a an instant timeout (0).

This also fixes an issue with stale fingerprint data: if a persistent data volume was deleted and then recreated, previously the project data would not be copied over. This meant that the project could not be found, and it would require users to manually delete the fingerprint data or use single-used volumes.

This also checks if the container has been scheduled for deletion (the drop may not have completed), and errors out early if more calls are made to the container.

This also properly handles `docker rm` calls if the `docker stop` command worked without needing a `SIGKILL`: it silences the output of the error if the container wasn't found.
@Alexhuszagh Alexhuszagh added the bug label Jul 8, 2022
@Alexhuszagh Alexhuszagh requested a review from a team as a code owner July 8, 2022 08:06
@Alexhuszagh
Copy link
Contributor Author

There's a lot of comments but ~80% of them are comments, just to document clearly the behavior that's going on, the bugs we aim to prevent, etc.

@Alexhuszagh Alexhuszagh added the no changelog A valid PR without changelog (no-changelog) label Jul 8, 2022
Copy link
Member

@Emilgardis Emilgardis left a comment

Choose a reason for hiding this comment

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

bors r+

nice!

@bors
Copy link
Contributor

bors bot commented Jul 8, 2022

Build succeeded:

@bors bors bot merged commit d43dc25 into cross-rs:main Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug no changelog A valid PR without changelog (no-changelog)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants