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

Always destroy exec container on cleanup #6722

Merged
merged 3 commits into from
Nov 19, 2019
Merged

Conversation

notnoop
Copy link
Contributor

@notnoop notnoop commented Nov 19, 2019

Fixes a bug where executor based drivers may orphan processes. If exec task spawns off processes in background, doesn't propagate signals to them, and doesn't kill them on its own completion, the background processes get orphaned and remain running after Nomad task completes.

This fixes the issue by ensuring that containers get shutdown and destroyed even if exec init process terminated.

@notnoop notnoop added this to the 0.10.2 milestone Nov 19, 2019
Copy link
Member

@schmichael schmichael left a comment

Choose a reason for hiding this comment

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

Don't forget changelog entry.

@@ -251,6 +254,104 @@ func TestExecDriver_StartWaitRecover(t *testing.T) {
require.NoError(harness.DestroyTask(task.ID, true))
}

func TestExecDriver_DestroyKillsAll(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm a sucker for succinct descriptions on tests, but not a blocker.

Suggested change
func TestExecDriver_DestroyKillsAll(t *testing.T) {
// TestExecDriver_DestroyKillsAll asserts that when TaskDestroy is called all
// task processes are cleaned up.
func TestExecDriver_DestroyKillsAll(t *testing.T) {

@notnoop notnoop merged commit 6907748 into master Nov 19, 2019
@notnoop notnoop deleted the b-always-destroy-executor branch November 19, 2019 20:55
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants