moby/integration/container
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
..
testdata/cdi Add support for CDI devices to docker daemon under linux 2023-05-16 17:07:57 +02:00
attach_test.go api/types: move ContainerAttachOptions to api/types/container 2023-10-12 11:29:23 +02:00
cdi_test.go cdi: use separate feature-flag 2024-01-17 11:31:37 +01:00
checkpoint_test.go api/types: move ContainerStartOptions to api/types/container 2023-10-12 11:29:24 +02:00
container_test.go Wire up tests to support otel tracing 2023-09-07 18:38:22 +00:00
copy_test.go Wire up tests to support otel tracing 2023-09-07 18:38:22 +00:00
create_test.go integration(-cli): remove skips for old daemon versions (<20.10) 2023-12-05 01:03:50 +01:00
daemon_linux_test.go api/types: move ContainerStartOptions to api/types/container 2023-10-12 11:29:24 +02:00
daemon_test.go api/types: move ContainerRemoveOptions to api/types/container 2023-10-12 11:29:23 +02:00
devices_windows_test.go api/types: move ContainerStartOptions to api/types/container 2023-10-12 11:29:24 +02:00
diff_test.go c8d: Fix docker diff 2023-09-20 14:16:22 +02:00
exec_linux_test.go Wire up tests to support otel tracing 2023-09-07 18:38:22 +00:00
exec_test.go integration(-cli): remove skips for old daemon versions (<20.10) 2023-12-05 01:03:50 +01:00
export_test.go Wire up tests to support otel tracing 2023-09-07 18:38:22 +00:00
health_test.go Wire up tests to support otel tracing 2023-09-07 18:38:22 +00:00
inspect_test.go daemon: only add short cid to aliases for custom networks 2024-01-23 17:09:11 +01:00
ipcmode_linux_test.go integration(-cli): remove skips for old daemon versions (<20.10) 2023-12-05 01:03:50 +01:00
kill_test.go integration/container: TestKillDifferentUserContainer: adjust API version 2023-12-04 22:38:52 +01:00
links_linux_test.go api/types: move ContainerListOptions to api/types/container 2023-10-12 11:29:24 +02:00
logs_test.go api/types: move ContainerLogsOptions to api/types/container 2023-10-12 11:30:12 +02:00
main_test.go Wire up tests to support otel tracing 2023-09-07 18:38:22 +00:00
mounts_linux_test.go integration(-cli): remove skips for old daemon versions (<20.10) 2023-12-05 01:03:50 +01:00
nat_test.go api/types: move ContainerLogsOptions to api/types/container 2023-10-12 11:30:12 +02:00
overlayfs_linux_test.go Wire up tests to support otel tracing 2023-09-07 18:38:22 +00:00
pause_test.go integration(-cli): remove skips for old daemon versions (<20.10) 2023-12-05 01:03:50 +01:00
pidmode_linux_test.go api/types: move ContainerStartOptions to api/types/container 2023-10-12 11:29:24 +02:00
ps_test.go api/types: move ContainerListOptions to api/types/container 2023-10-12 11:29:24 +02:00
remove_test.go api/types: move ContainerRemoveOptions to api/types/container 2023-10-12 11:29:23 +02:00
rename_test.go daemon: rename: don't reload endpoint from datastore 2024-01-23 22:53:43 +01:00
resize_test.go integration(-cli): remove skips for old daemon versions (<20.10) 2023-12-05 01:03:50 +01:00
restart_test.go integration: test container healthcheck is reset 2024-01-15 15:30:22 -05:00
run_cgroupns_linux_test.go integration: don't poll for containers to be running 2023-09-08 23:05:43 +02:00
run_linux_test.go libnetwork: loosen container IPAM validation 2024-01-20 11:33:04 +01:00
stats_test.go integration: don't poll for containers to be running 2023-09-08 23:05:43 +02:00
stop_linux_test.go integration: Fix Parallel before setupTest 2024-01-17 13:06:05 +01:00
stop_test.go Wire up tests to support otel tracing 2023-09-07 18:38:22 +00:00
stop_windows_test.go Wire up tests to support otel tracing 2023-09-07 18:38:22 +00:00
update_linux_test.go integration: don't poll for containers to be running 2023-09-08 23:05:43 +02:00
update_test.go Wire up tests to support otel tracing 2023-09-07 18:38:22 +00:00
wait_test.go api/types: move ContainerStartOptions to api/types/container 2023-10-12 11:29:24 +02:00