open-nomad/drivers/docker
Michael Schurter df3467a6ce docker: fix send after close panic in stats
destCh was being written to by one goroutine and closed by another
goroutine. This panic occurred in Travis:

```
=== FAIL: drivers/docker TestDockerCoordinator_ConcurrentPulls (117.66s)
=== PAUSE TestDockerCoordinator_ConcurrentPulls
=== CONT  TestDockerCoordinator_ConcurrentPulls

panic: send on closed channel

goroutine 5358 [running]:
github.com/hashicorp/nomad/drivers/docker.dockerStatsCollector(0xc0003a4a20, 0xc0003a49c0, 0x3b9aca00)
	/home/travis/gopath/src/github.com/hashicorp/nomad/drivers/docker/stats.go:108 +0x167

created by
github.com/hashicorp/nomad/drivers/docker.TestDriver_DockerStatsCollector
	/home/travis/gopath/src/github.com/hashicorp/nomad/drivers/docker/stats_test.go:33 +0x1ab
```

The 2 ways to fix this kind of error are to either (1) add extra
coordination around multiple goroutines writing to a chan or (2) make it
so only one goroutines writes to a chan.

I implemented (2) first as it's simpler, but @notnoop pointed out since
the same destCh in reused in the stats loop there's now a double close
panic possible!

So this implements (1) by adding a *usageSender struct for handling
concurrent senders and closing.
2019-04-02 08:28:08 -07:00
..
cmd
docklog rename fifo methods for clarity 2019-04-01 16:52:58 -04:00
test-resources/docker
util
config.go
config_test.go Support driver config fields being set to nil (#5391) 2019-03-05 21:47:06 -05:00
coordinator.go
coordinator_test.go
driver.go docker: restore pre-0.9 container names 2019-03-29 13:55:43 -07:00
driver_darwin_test.go
driver_default.go
driver_linux_test.go
driver_pre09.go
driver_test.go docker: restore pre-0.9 container names 2019-03-29 13:55:43 -07:00
driver_unix_test.go
driver_windows.go
driver_windows_test.go
fingerprint.go
fingerprint_test.go
handle.go
progress.go
progress_test.go
state.go
stats.go docker: fix send after close panic in stats 2019-04-02 08:28:08 -07:00
stats_test.go docker: fix send after close panic in stats 2019-04-02 08:28:08 -07:00
utils.go Validate all auth fields being empty rather than just email 2019-03-13 11:47:37 -05:00
utils_test.go
utils_unix_test.go
utils_windows_test.go