fix(isotp): wake receivers when the reader fails on an exception the generic-catch filter excludes - #268
Conversation
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
PR SummaryMedium Risk Overview For fatal reader failures (e.g. Adds an integration theory test that simulates excluded reader failures and asserts both concurrent and subsequent receives, Reviewed by Cursor Bugbot for commit c660fd2. Bugbot is set up for automated code reviews on this repo. Configure here. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 178a801920
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…generic-catch filter excludes The filter that closed the generic-catch alert let those exceptions fault the reader task without publishing inbox loss. Publish the same loss first, then rethrow, so ReceiveAsync wakes and the task still faults. Co-authored-by: Dietmar Borgards <dborgards@users.noreply.github.com>
Potential fix for https://github.com/dborgards/CanKit.Pro/security/code-scanning/468
Use a filtered catch instead of a fully generic catch in
RunReaderAsyncso only non-fatal exceptions are treated as subscription loss.Best fix in this snippet:
src/CanKit.Pro.IsoTp/IsoTpChannel.cs, withinRunReaderAsync, replace:catch (Exception ex)catch (Exception ex) when (ex is not OutOfMemoryException and not StackOverflowException and not AccessViolationException and not AppDomainUnloadedException and not BadImageFormatException and not CannotUnloadAppDomainException and not ThreadAbortException)Why this is best here:
lost).Suggested fixes powered by Copilot Autofix. Review carefully before merging.