Skip to content

feat(channel): add message send retry mechanism with exponential backoff#2478

Merged
Re-bin merged 3 commits intomainfrom
feat/channel_retry
Mar 25, 2026
Merged

feat(channel): add message send retry mechanism with exponential backoff#2478
Re-bin merged 3 commits intomainfrom
feat/channel_retry

Conversation

@chengyongru
Copy link
Copy Markdown
Collaborator

  • Add send_max_retries config option (default: 3, range: 0-10)
  • Implement _send_with_retry in ChannelManager with 1s/2s/4s backoff
  • Propagate CancelledError for graceful shutdown
  • Fix telegram send_delta to raise exceptions for Manager retry
  • Add comprehensive tests for retry logic
  • Document channel settings in README

- Add send_max_retries config option (default: 3, range: 0-10)
- Implement _send_with_retry in ChannelManager with 1s/2s/4s backoff
- Propagate CancelledError for graceful shutdown
- Fix telegram send_delta to raise exceptions for Manager retry
- Add comprehensive tests for retry logic
- Document channel settings in README
@chengyongru
Copy link
Copy Markdown
Collaborator Author

manual tested

@chengyongru chengyongru requested a review from Re-bin March 25, 2026 10:40
Re-bin added 2 commits March 25, 2026 14:12
Make channel delivery failures raise consistently so retry policy lives in ChannelManager rather than being split across individual channels. Tighten Telegram stream finalization, clarify sendMaxRetries semantics, and align the docs with the behavior the system actually guarantees.
Copy link
Copy Markdown
Collaborator

@Re-bin Re-bin left a comment

Choose a reason for hiding this comment

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

This PR is going in the right direction.

Retries should not be scattered across channels. They should live in one place. Failure should mean one thing. And the system should not promise behavior it does not actually deliver.

So I tightened the design.

What changed

  • kept retry policy in ChannelManager
  • made channel send failures raise consistently instead of being silently swallowed
  • fixed Telegram streaming so finalization failure can also participate in retry
  • clarified sendMaxRetries semantics so config and behavior say the same thing
  • tightened the README so it describes the real contract, not an aspirational one

Why this matters

A system like this should feel simple.

A channel should do one job: send.
If sending fails, it should say so.
The manager should do one job: decide whether to retry.

That is cleaner.
That is easier to reason about.
That is easier to test.
And most importantly, that is easier to trust.

Result

The structure is now more minimal and more decoupled.

Instead of adding retry behavior on top of inconsistent failure handling, the code now has a clearer contract:

  • channels perform delivery
  • the manager owns retry strategy
  • documentation matches reality

That is a much better foundation.

Validation

  • focused channel and Telegram retry tests passed
  • full test suite passed locally

@Re-bin Re-bin merged commit f0f0bf0 into main Mar 25, 2026
3 checks passed
@Re-bin Re-bin deleted the feat/channel_retry branch March 25, 2026 16:33
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.

2 participants