Repository navigation
fix(portal): bound the recovery-lock wait and log lock transitions and reopens - #255
Conversation
…d reopens A desktop connection that starts while the session is locked stays on the synthetic locked video until the auto unlock, and only the maintain loop reacts to that unlock. This morning a chain of such connections produced no maintain activity at all: no reopen log, no recovery-deferred log, no outcome - the viewer sat on black frames until its video timeout. Three blameless suspects can all go silent the same way: an attempt cancelled by backoff or supersession, the opening gate held by a zombie worker, or recover() spinning forever on a recovery lock another opener never released. - recover(): bound the try_lock wait to 15s and return code 3, so a wedged holder surfaces as 'recovery deferred' instead of an attempt that never ends. - maintain(): log each lock-state transition the loop reacts to, and log when it stops because a newer connection superseded it. - portal_attempt(): log every real reopen so a hang after this line pins the stall to the blocking open/recovery worker.
|
看过 9fd7ffa: @codex review 🤖 Generated with Claude Code |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex 复审无问题、CI 全绿,已 squash 合并,将随下个版本发布。感谢! 🤖 Generated with Claude Code |
Problem
A desktop connection that starts while the session is locked stays on the synthetic locked video until the auto unlock, and only the maintain loop reacts to that unlock. During a real incident this morning, a chain of such connections produced no maintain activity at all: no reopen log, no recovery-deferred log, no outcome — the viewer sat on black frames until its video timeout, and there was no way to tell where the pipeline stalled.
Three blameless suspects can all go silent the same way:
recover()spinning forever on a recovery lock another opener never released.Suspect 3 is a genuine hazard on its own: the
try_lockretry loop has no bound, so a wedged holder turns every future attempt into an attempt that never ends.Fix
portal.rsrecover(): bound therecovery.try_lock()wait to 15s and return code 3 (Retry), so a wedged holder surfaces as "recovery deferred" instead of an attempt that never ends.desktop_session.rsmaintain(): log each lock-state transition the loop reacts to (Portal desktop lock transition: state=... defer=...) and log when it stops because a newer connection superseded it.desktop_session.rsportal_attempt(): log every real reopen (Portal attempt: reopening the capture session) so a hang after this line pins the stall to the blocking open/recovery worker.These logs proved their worth the same day: the next "connect to a locked machine" incident walked through
lock transition→reopening→ silence, plus an xdg-desktop-portal-gnome dialog log — which immediately ruled out all three code suspects and identified the real cause (a consent dialog waiting for a click nobody was there to make).Tested:
desktop_session22 passed,portal27 passed,cargo checkclean.