Skip to content

fix: handle afterLease timeout and retry Dial on RESOURCE_EXHAUSTED#600

Draft
raballew wants to merge 2 commits intojumpstarter-dev:mainfrom
raballew:051-afterlease-timeout-fix
Draft

fix: handle afterLease timeout and retry Dial on RESOURCE_EXHAUSTED#600
raballew wants to merge 2 commits intojumpstarter-dev:mainfrom
raballew:051-afterlease-timeout-fix

Conversation

@raballew
Copy link
Copy Markdown
Member

Summary

  • Add RESOURCE_EXHAUSTED to the client-side Dial retry loop so callers recover from the controller's non-blocking sendToListener channel send
  • Separate connection loss handling during afterLease: loss while hook is RUNNING is now graceful (informational log), only FAILED triggers ExporterOfflineError

Closes #243

Test plan

  • Verify Dial retries on RESOURCE_EXHAUSTED
  • Verify connection loss during RUNNING afterLease hook does not raise
  • Run make pkg-test-jumpstarter-cli and make pkg-test-jumpstarter

🤖 Generated with Claude Code

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 17, 2026

Important

Review skipped

Draft detected.

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

Run ID: 09694d49-8e12-43e0-96c7-7949d4e099d2

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

raballew and others added 2 commits April 17, 2026 12:40
…nning afterLease hook

When the lease duration expires on the controller while the afterLease hook
is still running, the controller tears down the router connection. The client's
status monitor detects this as connection lost. Previously, the client treated
connection loss during AFTER_LEASE_HOOK as an error, raising
ExporterOfflineError. This is incorrect because the exporter is still running
the hook autonomously -- only the monitoring connection was lost.

The fix separates the handling: connection loss while the hook has FAILED is
still an error, but connection loss while the hook is still RUNNING is handled
gracefully with an informational log message.

The afterLease result handling logic is also extracted into a standalone
_handle_after_lease_result function for testability.

Generated-By: Forge/20260416_202053_681470_d8e513a2_i243
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…sendToListener

The controller's sendToListener now uses a non-blocking channel send that
returns RESOURCE_EXHAUSTED when the listener buffer is full instead of
blocking. Add RESOURCE_EXHAUSTED to the client-side Dial retry loop so
callers transparently recover from this transient condition.

Generated-By: Forge/20260416_202053_681470_d8e513a2_i243
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@raballew raballew force-pushed the 051-afterlease-timeout-fix branch from 05442e3 to bf49a31 Compare April 17, 2026 10:45
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 enabled: client times out and disconnects prematurely during long afterLease

1 participant