Repository navigation
Conversation
Contributor
Author
|
The failed CI job reports 510/511 tests passing. The failure is I reran all three concurrent-publish variants on .NET 10 locally against both unmodified master Could a maintainer rerun the failed test job? My API rerun request was denied with HTTP 403. Job: https://github.com/dotnet/MQTTnet/actions/runs/33817487297/job/100852725884 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #2256.
The server currently suppresses the Will for every client DISCONNECT and every takeover, and otherwise publishes immediately without observing Will Delay. Honor DISCONNECT 0x04 and the MQTT Will lifecycle with an internal scheduler that captures each connection's Will, identity and deadline.
Only normal client DISCONNECT (0x00) suppresses the Will. Other eligible disconnects publish after the earlier of Will Delay and session expiry. Resuming the same session before that deadline cancels the pending Will; an overdue Will, clean start, or zero-delay takeover publishes the old connection's Will. Connection ownership prevents late cleanup from changing the new connection's Will. Captured message expiry begins at publication.
The scheduler dispatches outside session/state locks, owns its background task, and preserves undispatched messages if a callback stops the server. With persistent sessions, deadlines survive stop/restart of the same server instance and overdue work runs before accepting reconnects. Nonpersistent shutdown and final disposal end sessions and flush eligible Wills. This adds no durable storage or public API, and does not claim persistence across process restart.
Dependency: this PR consumes the session's existing ExpiryInterval property. Correct DISCONNECT expiry replacement, including explicit zero, and resumed CONNECT expiry require #2264. Those changes are deliberately not bundled here. Both PRs were also tested together in an isolated local checkout.
Specification:
Compatibility: normal-disconnect suppression remains; MQTT 3.1.1 takeover now publishes the old Will as required. The existing takeover test expected suppression and is corrected accordingly. Timed dispatch has 100 ms scheduling granularity. Existing persistent-session storage remains in memory.
Synthetic regressions for DISCONNECT 0x04, another nonzero reason and ignored Will Delay all fail on unmodified master 18731d9; the normal-disconnect control passes. Tests cover takeover/resume ownership, rejected and expired reconnects, expiry versus delay, deletion/timer races, retained/message-expiry fields, disabled persistence, final disposal, active/pending stop and restart, callback-triggered shutdown from timer/startup, preserved next Wills, and nonrecursive nonpersistent shutdown.
Validation: