quickfixgo / quickfix

The Go FIX Protocol Library :rocket:
https://www.quickfixgo.org/
Other
735 stars 288 forks source link

deadlock when disconnecting dynamic session #524

Closed shipa988 closed 1 year ago

shipa988 commented 1 year ago

this kind of writing in channel makes deadlock possibility! https://github.com/quickfixgo/quickfix/blob/7945e4b53d7be2e68202fe68952ee31f2a736ccc/session.go#L742

Possible deadlock occurs in dynamic session closing because line https://github.com/quickfixgo/quickfix/blob/7945e4b53d7be2e68202fe68952ee31f2a736ccc/session.go#L768

is the only reader from channel s.sessionEvent, and after ending of loop https://github.com/quickfixgo/quickfix/blob/7945e4b53d7be2e68202fe68952ee31f2a736ccc/session.go#L752 no one can read from channel s.sessionEvent

PR #523

Thanks!