Skip to content

Preserve publish queue timestamp ordering - #4084

Merged
marcschier merged 6 commits into
master378from
copilot/bug-fix-monitored-item-notifications
Aug 1, 2026
Merged

Preserve publish queue timestamp ordering#4084
marcschier merged 6 commits into
master378from
copilot/bug-fix-monitored-item-notifications

Conversation

Copilot AI commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Proposed changes

The master378 publish timer reset timestamps for already-ready subscriptions, breaking oldest-first ordering among equal-priority subscriptions.

  • Restore the ready-subscription guard.
  • Recheck readiness under the queue lock to prevent concurrent timestamp resets.
  • Replace invalid requeue coverage with a deterministic ordering regression test.

Related Issues

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply. You can also fill these out after creating the PR.

  • Bugfix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds functionality)
  • Test enhancement (non-breaking change to increase test coverage)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected, requires version increase of Nuget packages)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc.
  • I have signed the CLA.
  • I ran tests locally with my changes, all passed.
  • I fixed all failing tests in the CI pipelines.
  • I fixed all introduced issues with CodeQL and LGTM.
  • I have added tests that prove my fix is effective or that my feature works and increased code coverage.
  • I have added necessary documentation (if appropriate).
  • Any dependent changes have been merged and published in downstream modules.

Further comments

Retains the single-lock lost-wakeup correction from the preceding change while preserving subscription scheduling timestamps.

@CLAassistant

CLAassistant commented Jul 23, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ marcschier
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI changed the title [WIP] Fix monitored item notifications stopping after SecureChannel token renewal Preserve publish queue timestamp ordering Jul 23, 2026
Copilot AI requested a review from marcschier July 23, 2026 14:00
Comment thread Libraries/Opc.Ua.Server/Subscription/SessionPublishQueue.cs
@marcschier
marcschier marked this pull request as ready for review July 23, 2026 14:21
Copilot AI review requested due to automatic review settings July 23, 2026 14:21
@marcschier marcschier added the 1.5.378 Only affects 1.5.378 (pre 2.0) label Jul 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Fixes a publish-queue regression where the publish timer could reset timestamps for already-ready subscriptions, breaking oldest-first ordering among equal-priority subscriptions.

Changes:

  • Reinstate a guard to avoid touching subscriptions already marked ReadyToPublish.
  • Recheck readiness under m_lock to avoid concurrent timestamp resets while assigning to requests.
  • Replace the prior requeue/wakeup test with a new regression test focused on timestamp-based ordering.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
Tests/Opc.Ua.Server.Tests/SessionPublishQueueRaceTests.cs Renames/reworks the test to validate timestamp ordering behavior for ready subscriptions.
Libraries/Opc.Ua.Server/Subscription/SessionPublishQueue.cs Adds readiness guards (outside and inside lock) to prevent timestamp/order corruption.

Comment thread Tests/Opc.Ua.Server.Tests/SessionPublishQueueRaceTests.cs
Comment thread Tests/Opc.Ua.Server.Tests/SessionPublishQueueRaceTests.cs Outdated
Comment thread Tests/Opc.Ua.Server.Tests/SessionPublishQueueRaceTests.cs Outdated
Comment thread Libraries/Opc.Ua.Server/Subscription/SessionPublishQueue.cs
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.16%. Comparing base (7e8f9e5) to head (ccbbfb5).
⚠️ Report is 1 commits behind head on master378.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##           master378    #4084      +/-   ##
=============================================
- Coverage      60.17%   60.16%   -0.01%     
=============================================
  Files            378      378              
  Lines          79070    79066       -4     
  Branches       13837    13837              
=============================================
- Hits           47577    47569       -8     
+ Misses         27080    27072       -8     
- Partials        4413     4425      +12     
Files with missing lines Coverage Δ
.../Opc.Ua.Server/Subscription/SessionPublishQueue.cs 75.20% <100.00%> (-1.21%) ⬇️

... and 20 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI requested a review from marcschier July 25, 2026 07:00
PRs targeting master378 never triggered the Actions workflow: the
pull_request branch filter only listed master/main/develop/*, and for
pull_request events GitHub evaluates the workflow file from the merge
commit (i.e. the master378 copy), so master's already-updated filter
never applied.

Branch protection additionally requires a 'Discover test projects'
check, a job that only exists in master's workflow, leaving every
master378 PR permanently stuck on 'Waiting for status to be reported'.

- Add master378 to the push and pull_request branch filters.
- Add the discover job so the required check is reported, and derive the
  test matrix from Tests/Opc.Ua.*.Tests instead of hand-maintaining it.
- Trigger on build/config file changes (props, targets, sln, slnx,
  global.json, NuGet.config) and on the workflow itself.
- Restrict the default GITHUB_TOKEN to contents: read.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 892a02b2-efa4-4a3b-bc9a-5e42103f4c26

@mrsuciu mrsuciu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcschier I think additional check is needed, see comment on code.

@marcschier marcschier added the ready Ready to merge once CI Passes label Jul 31, 2026
@marcschier
marcschier merged commit 6739b8c into master378 Aug 1, 2026
71 of 72 checks passed
@marcschier
marcschier deleted the copilot/bug-fix-monitored-item-notifications branch August 1, 2026 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.5.378 Only affects 1.5.378 (pre 2.0) ready Ready to merge once CI Passes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Monitored item notifications stop after SecureChannel token renewal in Kubernetes after upgrading from OPC UA .NET Standard 1.5.376 to 1.5.378

6 participants