Skip to content

Retry transient broker failures - #128

Merged
alefcastelo merged 1 commit into
mainfrom
retry-transient-broker-failures
Dec 5, 2026
Merged

alefcastelo merged 1 commit into
mainfrom
retry-transient-broker-failures

Conversation

@alefcastelo

Copy link
Copy Markdown
Member

A broker that is restarting or behind a proxy that briefly answers 503 no longer fails the command on the first try.

Every broker request now retries a refused or reset connection, a DNS error, an EOF before the response, and a 502, 503 or 504: three attempts in total, waiting 1s then 2s. Any other 4xx or 5xx fails at once, and the command's 30s timeout still bounds the whole run.

Before, a broker answering 503 once:

$ bidirekt list-participants
# fails with the 503

After: the CLI waits 1s, asks again, and prints the participants.

Writes retry too. A repeated identical request is safe on the broker: publishing the same version with the same content answers success without storing it again, recording a deployment that is already current answers success without a new row, and creating a participant or environment that exists answers 200 "already exists".

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Dec 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 55 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a71a1ba and 5c06d1f.

Files selected for processing: 2

  • internal/components/http_client.go
  • tests/components/http_client_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Every broker request now retries a refused or reset connection, a DNS
error, an EOF before the response, and a 502, 503 or 504, up to three
attempts with 1s then 2s between them. Other statuses fail at once, and
the command's timeout still bounds the whole run.

Writes retry too: the broker answers a repeated publish, deployment,
participant or environment with success and stores nothing twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alefcastelo
alefcastelo force-pushed the retry-transient-broker-failures branch from 5c06d1f to 92567a1 Compare December 5, 2026 05:02
@alefcastelo
alefcastelo merged commit e933dd0 into main Dec 5, 2026
12 checks passed
@alefcastelo
alefcastelo deleted the retry-transient-broker-failures branch December 5, 2026 05:05
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