Repository navigation
cyclic: bound missed-send recovery and preserve expiry causes - #94
Conversation
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: 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".
| select { | ||
| case <-task.bus.Done(): | ||
| return err |
There was a problem hiding this comment.
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 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
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.