8000 isotp: discard unread captured traffic without transmitting by tomrford · Pull Request #104 · tomrford/gocan · GitHub
[go: up one dir, main page]

Skip to content

isotp: discard unread captured traffic without transmitting - #104

Merged
tomrford merged 4 commits into
mainfrom
isotp-link-reset
Oct 19, 2026
Merged

tomrford merged 4 commits into
mainfrom
isotp-link-reset

Conversation

@tomrford
@tomrford tomrford commented Oct 19, 2026 •
Copy link
Copy Markdown
Owner

Recovering a receive address after a timeout required transmitting: Begin and a segmented Send both reposition the receive position, but only as a side effect of sending. A server that has already answered, or that must not answer, had no way to drop traffic it had not read.

Reset(ctx) repositions the link's receive position to the current end of the capture and transmits nothing, so the next Receive or Exchange.Next observes only frames that arrive afterwards. It takes the receiving token, so it waits for an in-progress Receive, a segmented Send, or an open Exchange instead of moving the position underneath one, and reports the caller's context error or the bus failure when that wait ends first. As with every cursor it discards captured traffic only; it does not flush the driver's receive queue.

acquire's select can take a free token even when the context or bus has already ended, so Reset rechecks both after it holds the token and releases the token on failure.

TestReset walks one server link through the contract inside a synctest bubble:

  • A cancelled Reset on an idle link fails, 32 times over, and never moves the position.
  • A real Reset drops a captured stale payload and transmits nothing.
  • The next Receive returns only the fresh payload.
  • A Reset under an open exchange stays blocked until the exchange closes.
  • On a closed bus, Reset reports gocan.ErrBusClosed.

Each of three mistakes makes the test fail: dropping the post-acquire recheck, skipping the token, and skipping the reposition.

🤖 Generated with Claude Code

A server that timed out mid-conversation had no way to drop the traffic it had
not read: Begin and a segmented Send both reposition the receive position but
transmit first. Reset repositions it to the current end of the capture and sends
nothing, so a caller can resynchronise the receive address.

Reset takes the receiving token, so it cannot move the position under an active
Receive, segmented Send, or open Exchange, and it reports the caller's context
error or the bus failure instead of waiting indefinitely. As with every cursor,
it discards captured traffic only and does not flush the driver's receive queue.

Amp-Thread-ID: https://ampcode.com/threads/T-01a15485-21ac-76eb-a8a3-dbbf21de0692
Co-authored-by: Amp <amp@ampcode.com>
@tomrford
tomrford marked this pull request as ready for review October 19, 2026 15:29
@chatgpt-codex-connector
chatgpt-codex-connector Bot commented Oct 19, 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-19T19:36:38.503034Z 135a1a2 Manual request
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2d93ff0c08

ℹ️ 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".

Comment thread isotp/isotp.go Resolved
When the token, ctx.Done and bus.Done are all ready, select may take the
token, so a cancelled Reset could still reposition the link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tomrford
Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 2d93ff0c08

ℹ️ 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".

@tomrford
Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 135a1a2c80

ℹ️ 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".

@tomrford
tomrford merged commit 1ab1ea8 into main Oct 19, 2026
1 check passed
@tomrford
tomrford deleted the isotp-link-reset branch October 19, 2026 19:55
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.

1 participant

0