no need to re-fetch the nameIndex during docker ps queries#33885
no need to re-fetch the nameIndex during docker ps queries#33885fabiokung wants to merge 1 commit intomoby:masterfrom
docker ps queries#33885Conversation
|
I don't think this solves the problem because the snapshotting of the containers themselves and the name index are done separately, with no guarantee that they return consistent results. To do this properly, we would have to add a name index to the memdb and rely on its atomic snapshotting. This would involve changing the type of data we store in the memdb from |
|
(...or even better, remove |
|
I agree that would be a better design, but also a bigger change. You are right that the snapshotting of containers and nameIndex happens separately, but they are very close: https://github.com/moby/moby/blob/master/container/view.go#L88-L89 Maybe slightly extending the |
|
... in that case we should also deep copy the |
1fd120b to
d348adb
Compare
|
I changed the commit message to indicate that this is not a fix, only a slight improvement, since we shouldn't be calling |
... by reusing the one that has been acquired for each query while taking a snapshot of the in-memory db. More context on moby#33863 Signed-off-by: Fabio Kung <[email protected]>
|
It seems like we're in agreement that pulling this information in the memdb is a better design. I agree that holding a lock around the snapshotting process could potentially work, but it would require expensive deep copies, and negate part of the benefit of this new lock-free code path. Unless there is a problem with using an out-of-date nameindex, I'd prefer to either leave this as-is or move everything into the memdb when we find time. BTW, it seems really broken that |
d348adb to
b62c627
Compare
|
Yep, I agreed with you at #33863 (comment) (sorry for spreading the discussion onto multiple threads) |
docker ps queries
|
I'm going to try moving the replacing the I'll open a PR, either tonight or sometime next week. |
|
does that mean we should close this PR? Thanks for thinking along btw, @fabiokung, much appreciated |
|
Let's reopen as needed. |
... by always using the one that has been snapshotted for each query.
Related to #33863
Signed-off-by: Fabio Kung [email protected]
/cc @aaronlehmann @thaJeztah