Skip to content

Comments

daemon: Ignore nonexistent containers when listing containers#33883

Closed
aaronlehmann wants to merge 1 commit intomoby:masterfrom
aaronlehmann:ignore-nonexistent-containers
Closed

daemon: Ignore nonexistent containers when listing containers#33883
aaronlehmann wants to merge 1 commit intomoby:masterfrom
aaronlehmann:ignore-nonexistent-containers

Conversation

@aaronlehmann
Copy link

The name/ID relationships are maintained separately from the memdb and can be out of sync from any particular memdb snapshot. If a container does not exist in the memdb, we must accept this as normal and not fail the listing. This is consistent with what the code used to do before memdb was introduced.

In combination with #33882, this fixes #33863

cc @fabiokung

The name/ID relationships are maintained separately from the memdb and
can be out of sync from any particular memdb snapshot. If a container
does not exist in the memdb, we must accept this as normal and not fail
the listing. This is consistent with what the code used to do before
memdb was introduced.

Signed-off-by: Aaron Lehmann <[email protected]>
return nil, err
}
if c != nil {
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.

view.Get() returns a "no such container" error if the container wasn't found; https://github.com/moby/moby/pull/33882/files#diff-a41e475815729f1ce9540241ddc3942fR138

Guess we should check for that error here, and return other errors?

Copy link
Contributor

@tiborvass tiborvass Jun 29, 2017

Choose a reason for hiding this comment

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

I agree with @thaJeztah it'd be better to also check for err != ErrNoSuchContainer and error out instead of silencing the error. Rationale: when someone adds a new error type that view.Get could return (i know it's unlikely but still), they wouldn't have to update all callers.

Copy link
Author

Choose a reason for hiding this comment

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

I've updated #33882 to return a typed error. Once that is merged, I can update this one to check for it specifically.

Copy link
Member

Choose a reason for hiding this comment

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

Other PR is merged.

@thaJeztah
Copy link
Member

@tiborvass @fabiokung @cpuguy83 carried in #33908 (Aaron is enjoying a couple of days off)

@thaJeztah thaJeztah closed this Jun 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flaky tests: docker-py: ServiceTest.test_create_service_with_secret

5 participants