[Server] Improve Request Queue, fix Event handling, add Tests - #3611
Merged
Merged
Conversation
…ce load test Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
…ublish wait Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
|
|
marcschier
approved these changes
Mar 13, 2026
romanett
marked this pull request as ready for review
March 19, 2026 06:21
marcschier
approved these changes
Mar 19, 2026
marcschier
added a commit
that referenced
this pull request
Jul 21, 2026
# Description Fixes a server-side lost wake-up in `SessionPublishQueue` that can permanently stop monitored-item notifications while the Session and SecureChannel remain healthy. In 1.5.378, `PublishAsync` checked for a ready Subscription under `m_subscriptionPublishLock` and then queued the Publish request under `m_lock`. A Subscription could become ready between those operations, be marked `ReadyToPublish` because no request was queued yet, and then leave the newly queued request stranded. Later timer ticks skipped assignment because the Subscription was already marked ready. This change backports the relevant `SessionPublishQueue` correction from #3611 and incorporates the review follow-up: - Makes the ready-Subscription check and Publish-request enqueue atomic under `m_lock`. - Synchronizes `PublishCompleted`, `Requeue`, and timer-driven assignment with the same lock. - Removes `m_subscriptionPublishLock`. - Invokes `SessionClosed` callbacks outside the queue lock. - Retries timer-driven assignment for already-ready, non-publishing Subscriptions instead of skipping them. - Adds deterministic regression tests for the lost-wakeup and requeue paths. ## Related Issues - Fixes #3997 - Backports the relevant queue fix from #3611 ## Testing - The focused `SessionPublishQueueRaceTests` fixture passes on net472, net48, net8.0, net9.0, and net10.0. - Earlier branch validation ran the full `UA.slnx` on net10.0 and net48 with zero failures. - Three pre-existing Quickstarts CA1823 warnings remain unchanged.
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.
Proposed changes
Types of changes
Checklist