Skip to content

Add server-side Dial retry for transient Available status#440

Open
ambient-code[bot] wants to merge 1 commit intomainfrom
fix/dial-server-side-retry-for-available-status
Open

Add server-side Dial retry for transient Available status#440
ambient-code[bot] wants to merge 1 commit intomainfrom
fix/dial-server-side-retry-for-available-status

Conversation

@ambient-code
Copy link
Copy Markdown
Contributor

@ambient-code ambient-code bot commented Apr 8, 2026

Summary

  • Adds a server-side retry loop in the controller's Dial handler when the exporter is in Available status (a transient state during lease setup)
  • Protects old clients (pre-client-side-retry) from the race condition where the client Dials before the exporter transitions to LeaseReady
  • Retry is bounded: up to 10 attempts with 300ms delay (~3s max), and only for Available status -- other error statuses (Offline, HookFailed) fail immediately

Context

When a lease is acquired, there's a race window between the client receiving Ready and the exporter completing its transition to LeaseReady. New clients handle this with client-side retry (already implemented in lease.py), but old clients fail with FAILED_PRECONDITION: "exporter is not ready (status: Available)".

This server-side fix complements the existing client-side retry and ensures backward compatibility.

Fixes #309

Test plan

  • Verify existing unit tests pass (go test ./internal/service/...)
  • Test with old client + new exporter + new controller to confirm the race condition is mitigated
  • Verify that non-transient statuses (Offline, HookFailed) still fail immediately without retry
  • Verify context cancellation is respected during the retry loop

🤖 Generated with Claude Code

When a client Dials immediately after lease acquisition, the exporter
may still be in "Available" status (transitioning to LeaseReady). Old
clients lack the client-side retry logic added in a previous fix, so
they fail with FAILED_PRECONDITION. This adds a brief server-side retry
loop (up to ~3s) in the controller's Dial handler for the transient
Available status, protecting old clients without requiring upgrades.

Fixes #309

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 8, 2026

Deploy Preview for jumpstarter-docs ready!

Name Link
🔨 Latest commit 8836976
🔍 Latest deploy log https://app.netlify.com/projects/jumpstarter-docs/deploys/69d6b9b302e6fd0008309943
😎 Deploy Preview https://deploy-preview-440--jumpstarter-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

hooks disabled: old client + new exporter + new controller

0 participants