Skip to content

fix: per-connection Dial retry with dual timeout budget - #951

Open
bennyz wants to merge 1 commit into
bz/restart-3from
bz/restart-4
Open

fix: per-connection Dial retry with dual timeout budget#951
bennyz wants to merge 1 commit into
bz/restart-3from
bz/restart-4

Conversation

@bennyz

@bennyz bennyz commented Aug 3, 2026

Copy link
Copy Markdown
Member

Replace pre-flight _dial_with_retry with handle_async that retries Dial on every Unix socket connection independently. Use dial_timeout (60s) for FAILED_PRECONDITION ("not ready") and retry_timeout (300s, only when _connected=True) for UNAVAILABLE, so initial lease acquisition stays fast while established sessions survive controller restarts.

Fix permission-denied detection: controller sends fmt.Errorf("permission denied") which maps to UNKNOWN, not PERMISSION_DENIED - match on details text instead of status code.

Depends on #950

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 922dcba2-f46d-460a-88a1-a80879ca2306

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

Comment thread python/packages/jumpstarter/jumpstarter/client/lease.py Outdated
async with anyio.from_thread.BlockingPortal() as portal:
connect_deadline = None
connect_start = None
while True:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Token monitor tasks accumulate without cancellation across outer retry iterations. It would be better tying the monitoring task lifetime to the lease using a per-lease cancel scope, cancelling the monitor in a finally block before each continue.

Comment thread python/packages/jumpstarter-cli/jumpstarter_cli/shell.py
Comment thread python/packages/jumpstarter/jumpstarter/client/lease.py Outdated
Comment thread python/packages/jumpstarter/jumpstarter/client/lease.py Outdated
Comment thread python/packages/jumpstarter/jumpstarter/client/lease.py Outdated
@bennyz
bennyz force-pushed the bz/restart-4 branch 2 times, most recently from 35f742f to d69330d Compare August 4, 2026 09:56
@bennyz
bennyz force-pushed the bz/restart-4 branch 2 times, most recently from 988d485 to 4c8b3db Compare August 5, 2026 10:34
@bennyz
bennyz force-pushed the bz/restart-4 branch 2 times, most recently from 75e434f to ba6c46c Compare August 16, 2026 12:25
@bennyz
bennyz force-pushed the bz/restart-4 branch 2 times, most recently from 37abc45 to 2af5cb3 Compare August 16, 2026 14:13
@bennyz
bennyz force-pushed the bz/restart-4 branch 2 times, most recently from 42cd146 to c452084 Compare August 19, 2026 18:01
Replace pre-flight _dial_with_retry with handle_async that retries Dial
on every Unix socket connection independently. Use dial_timeout (60s)
for FAILED_PRECONDITION ("not ready") and retry_timeout (300s, only when
_connected=True) for UNAVAILABLE, so initial lease acquisition stays
fast while established sessions survive controller restarts.

Fix permission-denied detection: controller sends fmt.Errorf("permission
denied") which maps to UNKNOWN, not PERMISSION_DENIED — match on
details text instead of status code.

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>
Assisted-by: claude-opus-4.6
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