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
Deadlock on image delete and container attach #22732
Comments
I'm thinking the best (and safest) way to fix this would be to make a copy in https://github.com/docker/docker/blob/a213a446d7828c54e9ce104b38e1adfd4827871e/container/memory_store.go#L66 before running the filters/apply and releasing the lock before the actual filters get called. cc @LK4D4 |
Let me know if there's anything more I can do to help with this. |
What are the odds that this will make it into the 1.12.0 release? |
Bump; I expect the 1.12 freeze is quickly approaching. |
I'll make sure this lands before |
Yeah, I think working with copies is best idea. |
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>
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> (cherry picked from commit bd2b3d3)
Trace from @bukzor in #22124 https://gist.github.com/394589b78225d9be727a3cd7a9381156
There seems to be different order of taking
container.Lock()
andmemoryStore.Lock()
. In the trace one way it shows is the contention between goroutines for attaching container stdio and removing images. It's not certain if this is the only way this deadlock can appear(even in this trace).The text was updated successfully, but these errors were encountered: