We use quickfix extensively in our systems and we are getting this panic several times per week across our services
panic: close of closed channel
goroutine 39832 [running]:
github.com/quickfixgo/quickfix/internal.(*EventTimer).Stop(...)
/go/pkg/mod/github.com/quickfixgo/quickfix@v0.7.1-0.20230509031336-098031ef5379/internal/event_timer.go:48
github.com/quickfixgo/quickfix.(*session).run.func3()
/go/pkg/mod/github.com/quickfixgo/quickfix@v0.7.1-0.20230509031336-098031ef5379/session.go:795 +0x4c
github.com/quickfixgo/quickfix.(*session).run(0xc00060cc00)
/go/pkg/mod/github.com/quickfixgo/quickfix@v0.7.1-0.20230509031336-098031ef5379/session.go:823 +0x446
github.com/quickfixgo/quickfix.(*Initiator).handleConnection.func1()
/go/pkg/mod/github.com/quickfixgo/quickfix@v0.7.1-0.20230509031336-098031ef5379/initiator.go:142 +0x25
created by github.com/quickfixgo/quickfix.(*Initiator).handleConnection in goroutine 39831
/go/pkg/mod/github.com/quickfixgo/quickfix@v0.7.1-0.20230509031336-098031ef5379/initiator.go:141 +0xd3
A solution could be to make EventTimer.Stop idempotent:
func (t *EventTimer) Stop() {
if t == nil {
return
}
t.once.Do(func() {
close(t.done)
})
t.wg.Wait()
}
This proposal is included in PR #580
We use quickfix extensively in our systems and we are getting this panic several times per week across our services
A solution could be to make
EventTimer.Stopidempotent:This proposal is included in PR #580