Apply closed channel fix

45619a5b7b
This commit is contained in:
Kuba Podgórski 2021-01-13 15:37:13 +01:00
parent 4afb0ecc51
commit 61edff3eee
2 changed files with 8 additions and 2 deletions

View file

@ -426,7 +426,13 @@ func (g *eventReceiver) NotifyUpdate(n *memberlist.Node) {
}
func (g *eventReceiver) Close() {
close(g.closed)
// TODO workaround to make tests pass. We are going to delete this code anyways.
select {
case <-g.closed:
return
default:
close(g.closed)
}
}
func (g *eventReceiver) listen() {

View file

@ -98,7 +98,7 @@ func (pm *globalPortMapper) allocateAtTop() {
pm.availPorts = make([]net.Listener, pm.numPorts)
i := 0
for next := 65000; i < pm.numPorts && next > 0; next-- {
for next := 65000; i < pm.numPorts && next > 1000; next-- {
lsn, err := net.Listen("tcp", fmt.Sprintf(":%d", next))
if err != nil {
//fmt.Printf("next=%v, err = %v\n", next+1, err)