From 1227254f0d5378ed7e1a7042bbf540bf900937d8 Mon Sep 17 00:00:00 2001 From: Paulo Date: Sun, 16 Aug 2026 19:43:29 +0200 Subject: [PATCH] The writer lock's TTL outlasts a real borrow TTL-only was the settled design when the renewal apparatus was cut, but the 60-second value from that renew-pair era rode along. A persist borrow runs for minutes (export alone allows five); the lock now lives three hours, past the browser container's own 150-minute lease. The login-window comment stops claiming a writer lock the window deliberately does not take. --- backend/druks/browser/constants.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/druks/browser/constants.py b/backend/druks/browser/constants.py index a14ba762..f5c6b8ae 100644 --- a/backend/druks/browser/constants.py +++ b/backend/druks/browser/constants.py @@ -5,13 +5,14 @@ BROWSER_SESSION_NAME_PATTERN = r"^[a-z](?:[a-z0-9-]*[a-z0-9])?$" SITE_MAX_LENGTH = 255 -WRITER_LOCK_TTL_SECONDS = 60 +# TTL-only, no renewal: must outlast the longest borrow, bounded by the +# browser container's 150-minute lease. +WRITER_LOCK_TTL_SECONDS = 3 * 60 * 60 SESSION_LAUNCH_TIMEOUT_SECONDS = 45 SESSION_EXPORT_TIMEOUT_SECONDS = 5 * 60 -# A login window holds the session's writer lock and its Redis record for as -# long as it may stay open; both lapse together if the operator walks away, and -# the container's own lease reaps it — nothing sweeps. +# A login window keeps only this Redis record; if the operator walks away it +# lapses and the container's own lease reaps the browser — nothing sweeps. LOGIN_WINDOW_TTL_SECONDS = 30 * 60 LOGIN_WINDOW_KEY_PREFIX = "browser_login_window:"