Skip to content

Commit

Permalink
Fix handling of PubRelMarker, missing inflightTimeouts.add()
Browse files Browse the repository at this point in the history
PubRelMarkers should not be added to inflightWindow, and should not
cause the inflightSlots being decremented.
Also makes sure that non-pubRelMarker messages get added to the
inflightTimeouts.
  • Loading branch information
hylkevds committed Jul 2, 2021
1 parent 9c540fd commit f4bd776
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions broker/src/main/java/io/moquette/broker/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ private void drainQueueToConnection() {
}
inflightSlots.decrementAndGet();
int sendPacketId = mqttConnection.nextPacketId();
inflightTimeouts.add(new InFlightPacket(sendPacketId, FLIGHT_BEFORE_RESEND_MS));

// Putting it in a map, but the retain is cancelled out by the below release.
EnqueuedMessage old = inflightWindow.put(sendPacketId, msg);
Expand Down

0 comments on commit f4bd776

Please sign in to comment.