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
Release memoryStore locks before filter/apply #22918
Conversation
Rework memoryStore so that filters and apply run on a cloned list of containers after the lock has been released. This avoids possible deadlocks when these filter/apply callbacks take locks for a container. Fixes moby#22732 Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Don't we still only have pointers to the containers? Should this be a copy of each container, or is the issue with the collection itself? |
@cpuguy83 The problem is that the |
Nice @tonistiigi ; this will help with some of the issues I have been looking at lately around lock contention. Specific to @cpuguy83's Q, the lock on the |
This could be a good use case for https://github.com/hashicorp/go-immutable-radix. Each change to the tree results in a new tree root, but all nodes except the parents of the changed node are shared by the new tree and the old tree. By using atomic pointer swaps to update the tree root, it's a good way to do cheap copy-on-write. This is how https://github.com/hashicorp/go-memdb works. |
This was your only failure:
|
LGTM |
1 similar comment
LGTM |
Upstream reference: moby#22918 Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream reference: moby#22918 Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Rework
memoryStore
so that filters and apply runon a cloned list of containers after the lock has
been released. This avoids possible deadlocks when
these filter/apply callbacks take locks for a
container.
Fixes #22732
Signed-off-by: Tonis Tiigi tonistiigi@gmail.com