Fix #455, #583, #587: inlfightSlots counting, CCE & QoS2 deadlock #601
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This set of commits is linked together to closely to make separate PRs for. It fixes:
MQTT durable subscription exception #455: resendInflightNotAcked() assumed all messages in the inflightWindow are PublishedMessage, but they can also be PubRelMarker. This caused a ClassCastException.
0.14: QOS 2 PubRel packets deadlocked in queue #587: When sending PubRelMessages, never put them on the queue, since this deadlocks the system.
0.14: InflightSlots counting not reliable #583: The inflight slots counting did not always work reliably, leading to a really large number of inflight slots.
The result of never putting PubRelMessages on the sessionQueue is that the sessionQueue can now only contain PublishedMessages, so the sessionQueue generic could be directly for that class.
This PR continues on #600 and supersedes #584 and #588.