8000 cyclic: bound missed-send recovery and preserve expiry causes by tomrford · Pull Request #94 · tomrford/gocan · GitHub
[go: up one dir, main page]

Skip to content

cyclic: bound missed-send recovery and preserve expiry causes - #94

Merged
tomrford merged 3 commits into
mainfrom
codex/cyclic-send-resilience
Oct 4, 2026
Merged

tomrford merged 3 commits into
mainfrom
codex/cyclic-send-resilience

Conversation

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

Recurring transmission currently stops after a single transient send failure, and occurrence expiry can surface as a bare deadline error or be mistaken for queue saturation. Add an opt-in MaxConsecutiveMisses allowance: 1 tolerates one failed send, acceptance resets the consecutive count, and a second consecutive failure stops the task. Zero retains fail-fast behaviour. Misses retain the original schedule without bursts.

Task.Missed exposes a cumulative count of tolerated and terminal failed send occurrences, so callers can poll for misses while the task runs. Acceptance leaves this total intact. Cancellation, Stop and bus closure do not increment it; elapsed schedule slots skipped without a failed send are not counted.

Add cyclic.ErrOccurrenceMissed for occurrence-budget expiry and preserve custom first-attempt context causes in gocan.Send while retaining standard errors.Is matching. Actual queue rejections remain identifiable. Definite native acceptance/failure, generation and validation failures, cancellation and Stop remain authoritative. Send deadlines are unchanged.

Validation: go test -race ./..., go vet ./..., gofmt checks, git diff --check, and Windows amd64/arm64/386 compile tests passed. Existing lifecycle tests cover cause reporting, bounded recovery, cumulative counting, live polling, reset after acceptance, scheduling and shutdown. Fresh independent reviews found no blockers. Physical hardware was not exercised.

@chatgpt-codex-connector
chatgpt-codex-connector Bot commented Oct 3, 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-04T15:06:20.916910Z d40c125 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: 495d4b585d

ℹ️ 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 cyclic/cyclic.go Outdated
Comment on lines +266 to +268
select {
case <-task.bus.Done():
return err
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the bus failure when aborting miss recovery

When the bus shuts down concurrently with a send returning ErrOccurrenceMissed or ErrTransmitQueueFull, this branch stops the task but returns only the transient send error. Consequently, Task.Err() does not match bus.Err() (or gocan.ErrBusClosed when that is nil), unlike the main bus.Done() path, so callers can misdiagnose a hardware disconnect or closure as queue saturation. Retrieve and join the bus's terminal cause here before returning.

Useful? React with 👍 / 👎.

@tomrford
tomrford commented Oct 4, 2026
Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

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

Reviewed commit: d40c125b32

ℹ️ 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 fa08d25 into main Oct 4, 2026
1 check passed
@tomrford
tomrford deleted the codex/cyclic-send-resilience branch October 4, 2026 18:01
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