Skip to content

fix(isotp): forward the owned actor shutdown timeout before detaching - #451

Closed
dborgards wants to merge 1 commit into
mainfrom
fix/isotp-shutdown-report-449
Closed

dborgards wants to merge 1 commit into
mainfrom
fix/isotp-shutdown-report-449

Conversation

@dborgards

@dborgards dborgards commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Superseded by #450, opened concurrently for the same issue 16 seconds before this PR. Both implement the same ownership seam and unsubscribe-after-dispose fix; #450 retains the active review and CI. Closing this duplicate to keep one authored PR open.

What does this change?

IsoTpChannel.Dispose now keeps its background-exception handler attached until its owned actor has finished disposing. A callback that outlives the actor's shutdown timeout therefore reaches channel subscribers through the existing asynchronous dispatcher. Borrowed actors remain owned by their callers and the channel still detaches its handler.

Closes #449. No public API change; the internal test constructor can explicitly take ownership of an injected actor.

Type of change

  • feat — new behaviour (minor release)
  • fix / perf — bug or performance fix (patch release)
  • docs / test / refactor / chore / ci — no release
  • Breaking change

Checklist

  • Build with -p:CI=true, test (net10.0), dotnet format --verify-no-changes, and pack + eng/verify-packages.py all pass locally
  • Public API changes are documented with XML comments — no public API change
  • New behaviour is covered by a test
  • The requirement or ADR this relates to is referenced — FR-RAW-023

Validation

  • Release build: zero warnings and errors; full net10.0 suite: 2881/2881 passed.
  • Regression: IsoTpChannelIntegrationTests.The_Shutdown_Timeout_Of_The_Channels_Own_Actor_Reaches_Its_Subscribers holds the actor callback until finally and awaits the dispatched timeout report. Restoring the old unsubscribe-before-dispose ordering makes this test fail with a timeout; restoring the fix passes.
  • Local Cobertura: the modified Dispose ownership branch has 100% condition coverage (2/2), and all modified executable lines have hits. All class entries for the source file were inspected, including nested types.
  • Format verification passed; fresh pack verified all 9 packages. Requirements traceability reports no new gaps; all 50 verification-script tests pass.
  • net48 execution is left to Windows CI.

@cursor

cursor Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes dispose ordering and actor-ownership semantics on the ISO-TP channel teardown path; behavior is covered by a new integration test and leaves the public API unchanged.

Overview
Fixes #449 / FR-RAW-023: when IsoTpChannel owns its ProtocolActor, Dispose now calls _actor.Dispose() before unsubscribing from BackgroundExceptionOccurred, so a shutdown join timeout raised during actor disposal still reaches channel subscribers via the existing async dispatcher. Borrowed actors are unchanged—the handler is always removed; only owned actors are disposed by the channel.

The internal test constructor gains an optional ownsActor flag so tests can inject an actor but still have the channel dispose it (production still creates and owns the actor when none is passed).

Adds The_Shutdown_Timeout_Of_The_Channels_Own_Actor_Reaches_Its_Subscribers, which blocks an actor callback across Dispose and asserts a TimeoutException is observed on BackgroundExceptionOccurred.

Reviewed by Cursor Bugbot for commit 1053891. Bugbot is set up for automated code reviews on this repo. Configure here.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T09:53:43.357619Z 1053891 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dborgards dborgards closed this Oct 25, 2026
@codecov

codecov Bot commented Oct 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ISO-TP: Dispose detaches the handler before its owned actor's shutdown, so a shutdown timeout is never reported

1 participant