[dotnet] [bidi] Unregister cancelled commands#17129
[dotnet] [bidi] Unregister cancelled commands#17129nvborisenko merged 6 commits intoSeleniumHQ:trunkfrom
Conversation
PR TypeBug fix Description
|
| Relevant files | |||
|---|---|---|---|
| Bug fix |
|
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||
There was a problem hiding this comment.
Pull request overview
Refines .NET BiDi Broker.ExecuteCommandAsync cancellation handling to avoid retaining canceled commands in the broker’s pending-command tracking, helping prevent memory growth over time during frequent cancellations/timeouts.
Changes:
- Dispose the cancellation token registration and add cleanup logic to remove canceled commands from
_pendingCommands. - Reorder command serialization relative to
_pendingCommandsregistration.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Refines the command execution logic in the
Brokerclass to improve resource management and prevent memory leaks when commands are canceled. The main change ensures that canceled commands are properly removed from the_pendingCommandsdictionary.🔄 Types of changes