closing eventCh after shutdown panics
- Dominant language
- Go
- Stars
- 6.1k
- Forks
- 609
- Avg merge
- 15h 1m
- Merged PRs (30d)
- 3
Description
I'm doing something like:
```
config := serf.DefaultConfig()
config.Init()
eventCh := make(chan serf.Event, 16)
config.EventCh = eventCh
```
...
then when I shutdown I do:
```
s.Leave()
s.Shutdown()
<-s.ShutdownCh()
close(eventCh)
```
But I get a panic:
```
panic: send on closed channel
goroutine 52 [running]:
swarm/vendor/github.com/hashicorp/serf/serf.(*serfQueries).stream(0xc4204b8150)
/home/predmond/src/swarm/go/src/swarm/vendor/github.com/hashicorp/serf/serf/internal_query.go:87 +0x15a
created by swarm/vendor/github.com/hashicorp/serf/serf.newSerfQueries
/home/predmond/src/swarm/go/src/swarm/vendor/github.com/hashicorp/serf/serf/internal_query.go:73 +0xfb
```
I've tested with my vendor directory up-to-date. As far as I know it's my responsibility to close the event channel and doing it after shutdown should be safe..
Contributor guide
Assessment
This issue has not been assessed yet.