Files
moby/daemon
Albin Kerouanton 5295e88ceb daemon: rename: don't reload endpoint from datastore
Commit 8b7af1d0f added some code to update the DNSNames of all
endpoints attached to a sandbox by loading a new instance of each
affected endpoints from the datastore through a call to
`Network.EndpointByID()`.

This method then calls `Network.getEndpointFromStore()`, that in
turn calls `store.GetObject()`, which then calls `cache.get()`,
which calls `o.CopyTo(kvObject)`. This effectively creates a fresh
new instance of an Endpoint. However, endpoints are already kept in
memory by Sandbox, meaning we now have two in-memory instances of
the same Endpoint.

As it turns out, libnetwork is built around the idea that no two objects
representing the same thing should leave in-memory, otherwise breaking
mutex locking and optimistic locking (as both instances will have a drifting
version tracking ID -- dbIndex in libnetwork parliance).

In this specific case, this bug materializes by container rename failing
when applied a second time for a given container. An integration test is
added to make sure this won't happen again.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
(cherry picked from commit 80c44b4b2e)
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2024-01-23 22:53:43 +01:00
..
2023-12-12 22:51:23 +01:00
2023-09-27 14:10:23 +08:00
…
2023-11-10 20:09:25 +00:00
2023-10-26 00:10:23 +01:00
2023-09-07 18:38:19 +00:00
2023-05-19 20:38:51 +02:00
2023-05-19 20:38:51 +02:00
…
2023-05-19 20:38:51 +02:00
2023-12-19 10:20:38 +01:00
2023-05-19 20:38:51 +02:00
2024-01-10 13:50:26 -05:00
2023-09-27 14:10:23 +08:00
2023-09-27 14:10:23 +08:00
…