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

Remove string test for container conflict #3513

Closed
wants to merge 4 commits into from
Closed

Remove string test for container conflict #3513

wants to merge 4 commits into from

Conversation

angrycub
Copy link
Contributor

@angrycub angrycub commented Nov 6, 2017

It appears that the upstream changed the error text returned on container conflict. This caused Nomad to not be able to create a new condition when docker stopped the container without cleaning up the container manually.

It appears that the upstream changed the error text returned on container conflict.  This caused Nomad to not be able to create a new condition when docker stopped the container without cleaning up the conainter manually.
@angrycub angrycub requested review from schmichael and dadgar November 6, 2017 22:33
@angrycub
Copy link
Contributor Author

angrycub commented Nov 6, 2017

Addresses #3419 and ZD-5338

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.

My comments aren't even blockers, but let's let someone else give this a review as well since we basically paired.

// Adding a / infront of the container name since Docker returns the
// container names with a / pre-pended to the Nomad generated container names
containerName := "/" + config.Name
d.logger.Printf("[DEBUG] driver.docker: searching for container name %q to purge", containerName)
Copy link
Member

Choose a reason for hiding this comment

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

Can you remove to purge from this log line? I know you didn't add it, but it seems grossly misleading as if we find a running container we do not purge it.

if err != nil {
d.logger.Printf("[ERR] driver.docker: failed to purge container %s", container.ID)
return nil, recoverableErrTimeouts(fmt.Errorf("Failed to purge container %s: %s", container.ID, err))
} else if err == nil {
Copy link
Member

Choose a reason for hiding this comment

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

Mind dropping the else if err == nil part? It's not necessary since the if err != nil bit returns.

I know this isn't your change, but I'd love to clean up some of this ugliness while we're in here.

@dadgar
Copy link
Contributor

dadgar commented Nov 14, 2017

This generally LGTM, please wait for @schmichael to see if this fixes the problem via the repro step of the linked issue before merging

@schmichael
Copy link
Member

Well @angrycub we tried. This fix works, but I'd prefer to get this fixed by updating our dockerclient as they have a workaround for this docker issue as well.

See #3551

@schmichael schmichael closed this Nov 15, 2017
@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 Mar 17, 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.

3 participants