moby/integration
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
..
build integration/build: Use setupTest 2023-12-05 12:49:30 +01:00
capabilities api/types: move ContainerLogsOptions to api/types/container 2023-10-12 11:30:12 +02:00
config Don't run tests twice 2023-09-19 11:37:55 +02:00
container daemon: rename: don't reload endpoint from datastore 2024-01-23 22:53:43 +01:00
daemon integration/TestLiveRestore: Wait for process to exit 2023-11-30 10:15:58 +01:00
distribution bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
image integration/image: Move Parallel after setupTest 2024-01-16 14:45:26 +01:00
internal libnetwork: loosen container IPAM validation 2024-01-20 11:33:04 +01:00
network integration(-cli): remove skips for old daemon versions (<20.10) 2023-12-05 01:03:50 +01:00
networking Remove generated MAC addresses on restart. 2024-01-22 19:51:54 +01:00
plugin Update authz plugin test to not use httputil 2023-12-18 13:16:36 -08:00
secret Wire up tests to support otel tracing 2023-09-07 18:38:22 +00:00
service libnet: remove Endpoint.anonymous 2023-12-20 19:04:37 +01:00
session integration(-cli): remove skips for old daemon versions (<20.10) 2023-12-05 01:03:50 +01:00
system integration(-cli): remove skips for old daemon versions (<20.10) 2023-12-05 01:03:50 +01:00
testdata/https Update test certificates 2021-05-18 09:43:21 +02:00
volume integration: Fix Parallel before setupTest 2024-01-17 13:06:05 +01:00
doc.go Add canonical import comment 2018-02-05 16:51:57 -05:00