fix: extend session linger to 24 hours#77
Merged
datasciencemonkey merged 2 commits intomainfrom Mar 24, 2026
Merged
Conversation
Sessions now survive for up to 24 hours of inactivity before cleanup reaps them. Active sessions with heartbeats live indefinitely — the timeout only applies to abandoned sessions. Cleanup interval bumped from 60s to 15min since frequent sweeps are unnecessary with a 24h window.
Owner
Author
|
Owner
Author
|
Tested on Databricks Apps and things function as expected. Merging. |
6 tasks
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
SESSION_TIMEOUT_SECONDSfrom 300s (5 min) to 86400s (24 hours) — sessions linger defensively; active sessions live indefinitely via heartbeats, abandoned sessions get 24h before cleanup reaps themCLEANUP_INTERVAL_SECONDSfrom 60s to 900s (15 min) — less frequent sweeps since timeout window is much largeros.close(slave_fd))MAX_CONTENT_LENGTH = 32 MBaligned with Claude Code's 30 MB file limitCloses #76, fixes #78, fixes #79
How it works — defensive by design
Active sessions send heartbeats every 30s which reset the idle clock, so they live indefinitely. The 24-hour timeout only applies to abandoned sessions (user closed tab, lost connection). If no sessions are lingering, the cleanup thread wakes every 15 min, finds nothing, and goes back to sleep — zero overhead.
Test plan
tests/test_session_linger.py— all passing