mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
5b55747a52
While this code was likely called from a single thread before, we have now seen panics, indicating that it could be called in parallel. This change adds a mutex to protect opening and closing of the channel. There may be another root cause associated with this panic, such as something that led to the calling of this in parallel, as this code is old and we had seen this condition until recently. This fix is by no means a permanent fix. Typically, bugs like this indicate misplaced channel ownership. In idiomatic uses, the channel should have a particular "owner" that coordinates sending and closure. In this case, the owner of the channel is unclear, so it gets opened lazily. Synchronizing this access is a decent solution, but a refactor may yield better results. Signed-off-by: Stephen J Day <stephen.day@docker.com> |
||
---|---|---|
.. | ||
stream | ||
archive.go | ||
container.go | ||
container_linux.go | ||
container_notlinux.go | ||
container_unit_test.go | ||
container_unix.go | ||
container_windows.go | ||
env.go | ||
env_test.go | ||
health.go | ||
history.go | ||
memory_store.go | ||
memory_store_test.go | ||
monitor.go | ||
mounts_unix.go | ||
mounts_windows.go | ||
state.go | ||
state_solaris.go | ||
state_test.go | ||
store.go | ||
view.go | ||
view_test.go |