You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docker-compose up fails because of creating a duplicate container -- we're not specifying replicas (and not setting the value), but it seems like it's trying to create the same container twice.
Container initial_worker-kochiku_mysql-1 Creating
Container initial_worker-kochiku_redis-1 Creating
Container initial_worker-kochiku_mysql-1 Created
Container initial_worker-kochiku_redis-1 Created
Container initial_worker-kochiku_build-1 Creating
Container initial_worker-kochiku_build-1 Creating
Container initial_worker-kochiku_build-1 Created
Error response from daemon: Conflict. The container name "/initial_worker-kochiku_build-1" is already in use by container "bd810aa12bd174ee0c47e0b35c75ae95ade367c89b45b45c632f1c400e3e426c". You have to remove (or rename) that container to be able to reuse that name.
Upon further investigation, the graph traversal algorithm may have a race condition. With a common parent, this can trigger multiple traversals to the parent and cause Docker creation to fail. Basically the algorithm appears to be:
The problem seems to be that both kochiku_mysql and kochiku_redis pointing to the same parent, so we launch multiple Goroutines to start them up. It seems as if filterAdjacentByStatusFn and updateStatus is the source of the race condition. If both calls to updateStatus completes before the filterAdjacentByStatusFn routine, we will see the parent being visited twice. I think there needs to be code added to check for already visited parent nodes.
Description
docker-compose upfails because of creating a duplicate container -- we're not specifying replicas (and not setting the value), but it seems like it's trying to create the same container twice.Can yield:
Upon further investigation, the graph traversal algorithm may have a race condition. With a common parent, this can trigger multiple traversals to the parent and cause Docker creation to fail. Basically the algorithm appears to be:
The problem seems to be that both kochiku_mysql and kochiku_redis pointing to the same parent, so we launch multiple Goroutines to start them up. It seems as if filterAdjacentByStatusFn and updateStatus is the source of the race condition. If both calls to updateStatus completes before the filterAdjacentByStatusFn routine, we will see the parent being visited twice. I think there needs to be code added to check for already visited parent nodes.
Steps to reproduce the issue:
What I did
compose/pkg/compose/dependencies.go
Lines 93 to 109 in 8a9c4b5
Related issue
Describe the results you received:
Every so often, I'd see:
Describe the results you expected:
Watch every so often the output vary between GOOD:
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker info:Additional environment details:
Repro'd locally on a MacOS with IntellIJ and the latest master. Problem shows up on latest Linux Docker versions.