fix: skip afterLease hook on client disconnect without EndSession#601
Draft
raballew wants to merge 2 commits intojumpstarter-dev:mainfrom
Draft
fix: skip afterLease hook on client disconnect without EndSession#601raballew wants to merge 2 commits intojumpstarter-dev:mainfrom
raballew wants to merge 2 commits intojumpstarter-dev:mainfrom
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
…mpstarter-dev#238) When a client exits a shell on a pre-created lease (release=False), the client does not call EndSession. Previously, _cleanup_after_lease would unconditionally run the afterLease hook and release the lease, making the pre-created lease unusable for reconnection. Add _should_run_after_lease_cleanup guard that skips afterLease hook and lease release when all of these conditions hold: EndSession was not requested, lease has not expired, and exporter is not shutting down. This keeps the lease active for reconnection. Existing tests updated to set lease_ended where they simulate lease expiry scenarios, matching the actual runtime behavior. Generated-By: Forge/20260416_202053_681470_ddfd9aba_i238 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The _should_run_after_lease_cleanup guard requires at least one condition to be set. Set lease_ended since the test simulates a scenario where cleanup is forced after timeout. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
52fd11a to
7dfa52f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
release=False), the client does not callEndSession, but_cleanup_after_leasewould unconditionally run the afterLease hook and release the lease_should_run_after_lease_cleanupguard that skips afterLease hook and lease release when EndSession was not requested, lease has not expired, and exporter is not shutting downCloses #238
Test plan
make pkg-test-jumpstarter🤖 Generated with Claude Code