Closed watfordgnf closed 4 years ago
Overall, LGTM other than the discard question. Feedback on #175 would be great before merging.
I'm unable to reproduce the failing test locally: BasicTests.TestPubMultiQueueSubWithSlowSubscriber
either has an unknown subscription or a duplicate message (unable to tell from the failure).
This resolves deadlocks seen when publishing small messages rapidly as detailed in #175.
The primary resolution is to not hold
addLock
while also holdingdLock
withinBlockingDictionary.Remove
(3d19c4b).A second observation is that
pubAckMap
can be madereadonly
, removing the need for an additional lock wrappingpubAckMap.Remove
when processing acks (384fb15).The last fix is to avoid deadlocks when the connection is lost unexpectedly, seen when interleaving very rapid publishing and publishing slowed with random intervals, by only waiting up to the ping interval before retrying (6d7cdb2).