Since order of case select is not guaranteed we got deadlock in a small percentage of cases due to socketError channel filling up when having multiple parallel write requests and the heartbeat picked the <-q.outgoingMessages instead of <-socketError case multiple subsequent times. Exiting the go-routine directly after writing to socketError mitigates the deadlock.
Since order of case
select
is not guaranteed we got deadlock in a small percentage of cases due tosocketError
channel filling up when having multiple parallel write requests and the heartbeat picked the<-q.outgoingMessages
instead of<-socketError
case multiple subsequent times. Exiting the go-routine directly after writing tosocketError
mitigates the deadlock.