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

engine: save dockerID in createContainer #2609

Merged
merged 1 commit into from
Sep 3, 2020
Merged

Conversation

fenxiong
Copy link
Contributor

@fenxiong fenxiong commented Sep 3, 2020

Summary

Previously, the dockerID in the dockerContainer struct of a container is only saved in termination handler. This means that if the agent is forcefully killed (e.g. via SIGKILL instead of SIGTERM), the dockerID is not saved, and as a result it will lose track of container. This commit fixes the issue by saving the dockerID after creating the container.

Implementation details

In the engine package, save the dockerID of the container after creating it.

Testing

Unit test added. Manually verified the fix by running a task, kill agent container with docker kill and stop the task, and verify the container can be stopped (without the fix, the container will be left running).

Will add an e2e test separately for the SIGKILL scenario.

New tests cover the changes: yes

Description for the changelog

Bug - fixed a bug where the agent can lose track of containers if it's stopped by SIGKILL instead of SIGTERM.

Licensing

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

Previously, the dockerID in the dockerContainer struct of a container is only saved in termination handler. This means that if the agent is forcefully stopped (e.g. via SIGKILL instead of SIGTERM), the dockerID is not saved, and as a result loses track of container if it is stopped by SIGKILL. This commit fixes the issue by saving the dockerID  after creating the container.
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.

6 participants