fix: per-connection Dial retry with dual timeout budget - #951
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
35c8335 to
17eb846
Compare
| async with anyio.from_thread.BlockingPortal() as portal: | ||
| connect_deadline = None | ||
| connect_start = None | ||
| while True: |
There was a problem hiding this comment.
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.
2ed068b to
2f50df1
Compare
35f742f to
d69330d
Compare
988d485 to
4c8b3db
Compare
75e434f to
ba6c46c
Compare
37abc45 to
2af5cb3
Compare
42cd146 to
c452084
Compare
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
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