fix: scope Cancel request matching to the current session - #4023
Merged
marcschier merged 1 commit intoJul 19, 2026
Merged
marcschier merged 1 commit into
marcschier merged 1 commit into
Conversation
romanett
approved these changes
Jul 18, 2026
marcschier
approved these changes
Jul 18, 2026
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4023 +/- ##
==========================================
- Coverage 73.85% 73.55% -0.31%
==========================================
Files 1345 1345
Lines 179988 179992 +4
Branches 31668 31668
==========================================
- Hits 132938 132388 -550
- Misses 36299 36905 +606
+ Partials 10751 10699 -52
🚀 New features to boost your workflow:
|
marcschier
pushed a commit
that referenced
this pull request
Aug 18, 2026
) Backport of 70c74e7 from `master` to `master378`. ### Summary Scopes `Cancel` request matching to the caller's session and adds a regression test verifying a request handle can no longer cancel work belonging to another session. ### Problem Per OPC UA Part 4, `Cancel` applies to a request handle from the same session that issued the original request. Previously `StandardServer.CancelAsync` validated the caller's session but forwarded only the raw `requestHandle` to `RequestManager.CancelRequests`, which iterated the global outstanding-request table and canceled every request whose `ClientHandle` matched — regardless of owning session. Since request handles are only session-scoped and different sessions can reuse the same value, one session could cancel another session's in-flight request. ### Changes - Pass the validated caller session id from `StandardServer.CancelAsync` into `RequestManager.CancelRequests`. - Restrict `RequestManager.CancelRequests` to requests whose `SessionId` **and** `ClientHandle` both match. - Update the existing request-manager test call and add `CancelRequestsDoesNotCancelMatchingHandleFromDifferentSession` regression test. ### Notes on the backport The `master378` branch predates the `RequestLifetime` cancellation model and the `SessionPublishQueueTests` present on `master`, so those parts of the original commit do not apply. The core fix and the regression test were adapted to this branch's `SetStatusCode`/`OperationStatus` model. `Opc.Ua.Server.Tests` builds clean and both `RequestManagerTests` pass. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
GoetzGoerisch
pushed a commit
to umati/connect
that referenced
this pull request
Sep 23, 2026
…5.378.176 (#45) This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [OPCFoundation.NetStandard.Opc.Ua](https://github.com/OPCFoundation/UA-.NETStandard) | `1.5.378.156` → `1.5.378.176` |  |  | --- ### Release Notes <details> <summary>OPCFoundation/UA-.NETStandard (OPCFoundation.NetStandard.Opc.Ua)</summary> ### [`v1.5.378.176`](https://github.com/OPCFoundation/UA-.NETStandard/releases/tag/1.5.378.176): OPC UA 1.05 Maintenance Update [Compare Source](OPCFoundation/UA-.NETStandard@1.5.378.156...1.5.378.176) Maintenance Release for fixing bugs found on the main378 development branch. #### Released packages [OPCFoundation.NetStandard.Opc.Ua](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua/1.5.378.176) [OPCFoundation.NetStandard.Opc.Ua.Core](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Core/1.5.378.176) [OPCFoundation.NetStandard.Opc.Ua.Security.Certificates](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Security.Certificates/1.5.378.176) [OPCFoundation.NetStandard.Opc.Ua.Configuration](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Configuration/1.5.378.176) [OPCFoundation.NetStandard.Opc.Ua.Server](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Server/1.5.378.176) [OPCFoundation.NetStandard.Opc.Ua.Client](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Client/1.5.378.176) [OPCFoundation.NetStandard.Opc.Ua.Client.ComplexTypes](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Client.ComplexTypes/1.5.378.176) [OPCFoundation.NetStandard.Opc.Ua.Bindings.Https](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Bindings.Https/1.5.378.176) [OPCFoundation.NetStandard.Opc.Ua.PubSub](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.PubSub/1.5.378.176) #### What's Changed - Fix publish queue lost wake-up by [@​marcschier](https://github.com/marcschier) in [#​4017](OPCFoundation/UA-.NETStandard#4017) - Obsolete legacy TraceConfiguration in favor of ITelemetryContext by [@​marcschier](https://github.com/marcschier) with [@​Copilot](https://github.com/Copilot) in [#​4090](OPCFoundation/UA-.NETStandard#4090) - Preserve publish queue timestamp ordering by [@​marcschier](https://github.com/marcschier) with [@​Copilot](https://github.com/Copilot) in [#​4084](OPCFoundation/UA-.NETStandard#4084) - Fix BadContinuationPointInvalid caused by empty continuation point in Browser.BrowseAsync by [@​marcschier](https://github.com/marcschier) in [#​4168](OPCFoundation/UA-.NETStandard#4168) - Add documentation for custom NodeSet2 authoring workflow by [@​romanett](https://github.com/romanett) with [@​Copilot](https://github.com/Copilot) in [#​4170](OPCFoundation/UA-.NETStandard#4170) - Fixed timer leaks in ChannelAsyncOperation.EndAsync ([#​3669](OPCFoundation/UA-.NETStandard#3669)) by [@​KarenKrill](https://github.com/KarenKrill) in [#​4166](OPCFoundation/UA-.NETStandard#4166) - Treat zero MaxNotificationsPerPublish as unlimited (OPC 10000-4) by [@​romanett](https://github.com/romanett) in [#​4263](OPCFoundation/UA-.NETStandard#4263) - fix(server): enforce browse continuation point limit at capacity ([#​4036](OPCFoundation/UA-.NETStandard#4036)) by [@​romanett](https://github.com/romanett) in [#​4270](OPCFoundation/UA-.NETStandard#4270) - Fix unordered server endpoint validation ([#​4029](OPCFoundation/UA-.NETStandard#4029)) \[backport to master378] by [@​romanett](https://github.com/romanett) in [#​4269](OPCFoundation/UA-.NETStandard#4269) - fix: don't return continuation points on BadNoContinuationPoints ([#​4022](OPCFoundation/UA-.NETStandard#4022)) \[backport to master378] by [@​romanett](https://github.com/romanett) in [#​4268](OPCFoundation/UA-.NETStandard#4268) - fix: scope Cancel request matching to the current session ([#​4023](OPCFoundation/UA-.NETStandard#4023)) by [@​romanett](https://github.com/romanett) in [#​4267](OPCFoundation/UA-.NETStandard#4267) - Set ContinuationPoint to null when browse is finished (port of [#​4057](OPCFoundation/UA-.NETStandard#4057)) by [@​romanett](https://github.com/romanett) in [#​4266](OPCFoundation/UA-.NETStandard#4266) - Default TransportQuotas in ApplicationConfiguration.ValidateAsync to prevent server-start NullReferenceException (backport to master378) by [@​romanett](https://github.com/romanett) in [#​4264](OPCFoundation/UA-.NETStandard#4264) - Fix ServerTimestamp update on read of stored/static nodes ([#​4257](OPCFoundation/UA-.NETStandard#4257)) by [@​romanett](https://github.com/romanett) in [#​4260](OPCFoundation/UA-.NETStandard#4260) - Fix reverse connect hold time when several Servers share one listener by [@​romanett](https://github.com/romanett) in [#​4341](OPCFoundation/UA-.NETStandard#4341) - \[master378] Fix Publish with maximum TimeoutHint by [@​mrsuciu](https://github.com/mrsuciu) in [#​4373](OPCFoundation/UA-.NETStandard#4373) - \[master378] Send the filtered retain trailing event with a client specific Retain = false by [@​romanett](https://github.com/romanett) in [#​4454](OPCFoundation/UA-.NETStandard#4454) - Master378 backport ctt changes by [@​mrsuciu](https://github.com/mrsuciu) in [#​4326](OPCFoundation/UA-.NETStandard#4326) - Update Microsoft.SourceLink.GitHub and Microsoft.SourceLink.AzureRepos.Git from 10.0.102 to 10.0.111 by [@​mrsuciu](https://github.com/mrsuciu) in [#​4465](OPCFoundation/UA-.NETStandard#4465) **Full Changelog**: <OPCFoundation/UA-.NETStandard@1.5.378.156...1.5.378.176> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - Between 12:00 AM and 03:59 AM (`* 0-3 * * *`) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC43Ny4wIiwidXBkYXRlZEluVmVyIjoiNDQuNzcuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Reviewed-on: https://codeberg.org/umati/connect/pulls/45 Signed-off-by: umati-bot <git-bot@umati.org>
GoetzGoerisch
pushed a commit
to umati/connect
that referenced
this pull request
Sep 28, 2026
…r to 1.5.378.176 (#46) This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [OPCFoundation.NetStandard.Opc.Ua.Server](https://github.com/OPCFoundation/UA-.NETStandard) | `1.5.378.156` → `1.5.378.176` |  |  | --- ### Release Notes <details> <summary>OPCFoundation/UA-.NETStandard (OPCFoundation.NetStandard.Opc.Ua.Server)</summary> ### [`v1.5.378.176`](https://github.com/OPCFoundation/UA-.NETStandard/releases/tag/1.5.378.176): OPC UA 1.05 Maintenance Update [Compare Source](OPCFoundation/UA-.NETStandard@1.5.378.156...1.5.378.176) Maintenance Release for fixing bugs found on the main378 development branch. #### Released packages [OPCFoundation.NetStandard.Opc.Ua](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua/1.5.378.176) [OPCFoundation.NetStandard.Opc.Ua.Core](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Core/1.5.378.176) [OPCFoundation.NetStandard.Opc.Ua.Security.Certificates](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Security.Certificates/1.5.378.176) [OPCFoundation.NetStandard.Opc.Ua.Configuration](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Configuration/1.5.378.176) [OPCFoundation.NetStandard.Opc.Ua.Server](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Server/1.5.378.176) [OPCFoundation.NetStandard.Opc.Ua.Client](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Client/1.5.378.176) [OPCFoundation.NetStandard.Opc.Ua.Client.ComplexTypes](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Client.ComplexTypes/1.5.378.176) [OPCFoundation.NetStandard.Opc.Ua.Bindings.Https](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Bindings.Https/1.5.378.176) [OPCFoundation.NetStandard.Opc.Ua.PubSub](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.PubSub/1.5.378.176) #### What's Changed - Fix publish queue lost wake-up by [@​marcschier](https://github.com/marcschier) in [#​4017](OPCFoundation/UA-.NETStandard#4017) - Obsolete legacy TraceConfiguration in favor of ITelemetryContext by [@​marcschier](https://github.com/marcschier) with [@​Copilot](https://github.com/Copilot) in [#​4090](OPCFoundation/UA-.NETStandard#4090) - Preserve publish queue timestamp ordering by [@​marcschier](https://github.com/marcschier) with [@​Copilot](https://github.com/Copilot) in [#​4084](OPCFoundation/UA-.NETStandard#4084) - Fix BadContinuationPointInvalid caused by empty continuation point in Browser.BrowseAsync by [@​marcschier](https://github.com/marcschier) in [#​4168](OPCFoundation/UA-.NETStandard#4168) - Add documentation for custom NodeSet2 authoring workflow by [@​romanett](https://github.com/romanett) with [@​Copilot](https://github.com/Copilot) in [#​4170](OPCFoundation/UA-.NETStandard#4170) - Fixed timer leaks in ChannelAsyncOperation.EndAsync ([#​3669](OPCFoundation/UA-.NETStandard#3669)) by [@​KarenKrill](https://github.com/KarenKrill) in [#​4166](OPCFoundation/UA-.NETStandard#4166) - Treat zero MaxNotificationsPerPublish as unlimited (OPC 10000-4) by [@​romanett](https://github.com/romanett) in [#​4263](OPCFoundation/UA-.NETStandard#4263) - fix(server): enforce browse continuation point limit at capacity ([#​4036](OPCFoundation/UA-.NETStandard#4036)) by [@​romanett](https://github.com/romanett) in [#​4270](OPCFoundation/UA-.NETStandard#4270) - Fix unordered server endpoint validation ([#​4029](OPCFoundation/UA-.NETStandard#4029)) \[backport to master378] by [@​romanett](https://github.com/romanett) in [#​4269](OPCFoundation/UA-.NETStandard#4269) - fix: don't return continuation points on BadNoContinuationPoints ([#​4022](OPCFoundation/UA-.NETStandard#4022)) \[backport to master378] by [@​romanett](https://github.com/romanett) in [#​4268](OPCFoundation/UA-.NETStandard#4268) - fix: scope Cancel request matching to the current session ([#​4023](OPCFoundation/UA-.NETStandard#4023)) by [@​romanett](https://github.com/romanett) in [#​4267](OPCFoundation/UA-.NETStandard#4267) - Set ContinuationPoint to null when browse is finished (port of [#​4057](OPCFoundation/UA-.NETStandard#4057)) by [@​romanett](https://github.com/romanett) in [#​4266](OPCFoundation/UA-.NETStandard#4266) - Default TransportQuotas in ApplicationConfiguration.ValidateAsync to prevent server-start NullReferenceException (backport to master378) by [@​romanett](https://github.com/romanett) in [#​4264](OPCFoundation/UA-.NETStandard#4264) - Fix ServerTimestamp update on read of stored/static nodes ([#​4257](OPCFoundation/UA-.NETStandard#4257)) by [@​romanett](https://github.com/romanett) in [#​4260](OPCFoundation/UA-.NETStandard#4260) - Fix reverse connect hold time when several Servers share one listener by [@​romanett](https://github.com/romanett) in [#​4341](OPCFoundation/UA-.NETStandard#4341) - \[master378] Fix Publish with maximum TimeoutHint by [@​mrsuciu](https://github.com/mrsuciu) in [#​4373](OPCFoundation/UA-.NETStandard#4373) - \[master378] Send the filtered retain trailing event with a client specific Retain = false by [@​romanett](https://github.com/romanett) in [#​4454](OPCFoundation/UA-.NETStandard#4454) - Master378 backport ctt changes by [@​mrsuciu](https://github.com/mrsuciu) in [#​4326](OPCFoundation/UA-.NETStandard#4326) - Update Microsoft.SourceLink.GitHub and Microsoft.SourceLink.AzureRepos.Git from 10.0.102 to 10.0.111 by [@​mrsuciu](https://github.com/mrsuciu) in [#​4465](OPCFoundation/UA-.NETStandard#4465) **Full Changelog**: <OPCFoundation/UA-.NETStandard@1.5.378.156...1.5.378.176> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - Between 12:00 AM and 03:59 AM (`* 0-3 * * *`) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC43Ny4wIiwidXBkYXRlZEluVmVyIjoiNDQuMTExLjQiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=--> Reviewed-on: https://codeberg.org/umati/connect/pulls/46 Signed-off-by: umati-bot <git-bot@umati.org>
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.
Summary
This PR scopes
Cancelrequest matching to the caller's session and adds regression tests that verify a request handle can no longer cancel work that belongs to another session.Problem
According to OPC UA Part 4,
Cancelapplies to a request handle from the same session that issued the original request. The server should not use a client-suppliedrequestHandleto match outstanding requests across all sessions.Previously,
StandardServer.CancelAsync()validated the caller's session but then forwarded only the rawrequestHandletoRequestManager.CancelRequests().RequestManageriterated the global outstanding-request table and canceled every request whoseClientHandlematched, without checking the owning session. Since request handles are only session-scoped and different sessions can legitimately reuse the same value, one session could cancel another session's in-flight request.Changes
StandardServer.CancelAsync()intoRequestManager.CancelRequests().RequestManager.CancelRequests()to requests whoseSessionIdandClientHandleboth match theCancelrequest.