putting a request message into c.subChanges blocks process with having c.pendingSubChangeMutex.Lock() when subscribe request is called twice during disconnection
this leads deadlock to wait c.pendingSubChangeMutex.Lock() in connWriter() when reconnecting
Changes:
drain c.subChanges channel when timeout happens. expecting this happens only when disconnected as c.subChanges are consumed before the timeout by connWriter() if connected.
Context:
c.subChanges
blocks process with havingc.pendingSubChangeMutex.Lock()
when subscribe request is called twice during disconnectionc.pendingSubChangeMutex.Lock()
inconnWriter()
when reconnectingChanges:
c.subChanges
channel when timeout happens. expecting this happens only when disconnected as c.subChanges are consumed before the timeout byconnWriter()
if connected.