Skip to content

fix(channel_select): adjust priority retry logic for cross-group - #2430

Merged
Calcium-Ion merged 1 commit into
mainfrom
fix/cross-group-retry
Dec 12, 2025
Merged

fix(channel_select): adjust priority retry logic for cross-group#2430
Calcium-Ion merged 1 commit into
mainfrom
fix/cross-group-retry

Conversation

@Calcium-Ion

@Calcium-Ion Calcium-Ion commented Dec 12, 2025

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes
    • Improved channel selection retry logic to better prioritize previously unsuccessful group selections and intelligently manage retry attempts across multiple group options.

✏️ Tip: You can customize this high-level summary in your review settings.

@Calcium-Ion
Calcium-Ion merged commit f9b6e4c into main Dec 12, 2025
1 check was pending
@coderabbitai

coderabbitai Bot commented Dec 12, 2025

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

Modified auto-group channel selection logic in service/channel_select.go to implement priority-based retry. The priorityRetry variable tracks retry attempts, being reset when advancing through auto-groups or after failed selections, while maintaining the previously selected auto-group index for context across retry iterations.

Changes

Cohort / File(s) Summary
Priority-based retry for auto-group selection
service/channel_select.go
Added priorityRetry variable initialized from retry and passed to GetRandomSatisfiedChannel. When cross-group retry is active with a prior auto-group index, advances startIndex to next group and resets priorityRetry to 0. Sets priorityRetry to 0 after unsuccessful selections or on success while storing the selected auto-group index.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Review the priority retry logic and verify the state transitions (priorityRetry reset conditions)
  • Confirm that auto-group index tracking correctly enables retry prioritization across iterations
  • Check that the algorithm handles edge cases (first group, last group, no eligible channels)

Poem

🐰 Through channels vast, a wise rabbit hops,
With priority-based retries—no more random stops!
Each group gets its chance, in order so neat,
Smart retry logic makes selection complete! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/cross-group-retry

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 30cb224 and b523f6a.

📒 Files selected for processing (1)
  • service/channel_select.go (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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