qmsk / e2

E2 Client, Tally output
Mozilla Public License 2.0
26 stars 7 forks source link

tally stop panics on source close #20

Open SpComb opened 7 years ago

SpComb commented 7 years ago

When shutting down the tally:

2017/02/03 23:54:18 Tally: stopping...
2017/02/03 23:54:18 tally: Update: sources=1 inputs=3 outputs=3 tallys=3
2017/02/03 23:54:18 xmlClient.writer: close
2017/02/03 23:54:18 xmlClient.read: read tcp4 192.168.56.1:39402->192.168.56.10:9876: use of closed network connection
2017/02/03 23:54:18 tally:Source 192.168.56.10: closed
panic: close of closed channel

goroutine 9 [running]:
panic(0x803c40, 0xc82023a080)
        /usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6
github.com/qmsk/e2/client.(*XMLClient).Close(0xc820114720)
        /home/build/go/src/github.com/qmsk/e2/client/xml.go:314 +0x30
github.com/qmsk/e2/tally.Source.run(0x0, 0x0, 0xa3f792, 0x4, 0xa3f80e, 0x4, 0xa3f7d1, 0x4, 0x2540be400, 0x100, ...)
        /home/build/go/src/github.com/qmsk/e2/tally/source.go:76 +0x2ae
created by github.com/qmsk/e2/tally.newSource
        /home/build/go/src/github.com/qmsk/e2/tally/source.go:35 +0x204

This is