fix(server): stop scene lock release from getting stuck on a canceled context (REL-03) - #2371
Open
wilfredmulenga wants to merge 2 commits into
Open
fix(server): stop scene lock release from getting stuck on a canceled context (REL-03)#2371wilfredmulenga wants to merge 2 commits into
wilfredmulenga wants to merge 2 commits into
Conversation
…se (REL-03) Explains why ReleaseSceneLock keeps discarding SaveLock's error and reusing the caller's (possibly canceled) context instead of detaching it.
Contributor
There was a problem hiding this comment.
Pull request overview
Documents an accepted REL-03 compliance-scan risk in ReleaseSceneLock, clarifying why SaveLock errors (including context canceled) are intentionally ignored and how stuck locks are recovered on process startup.
Changes:
- Adds a function-level comment explaining that
ReleaseSceneLockreuses the caller’s context and discardsSaveLockerrors (REL-03). - Describes the rare failure mode (caller context canceled) and the operational recovery path (
SceneLock.ReleaseAllLockon startup).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… context ReleaseSceneLock is deferred from publish flows using the same request context the publish itself used. If that context was already canceled (client disconnected mid upload), the SaveLock write failed silently and the scene stayed locked forever, since sceneLock has no TTL and the only other unlock path runs solely at process startup (REL-03, compliance scan). Detach the context before saving, bounded by a short timeout, and log the error instead of swallowing it.
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.
REL-03 from the compliance scan flags that ReleaseSceneLock discards SaveLock's error and reuses the same request context the failed publish was using. If that context is already canceled (client disconnected mid upload), the SaveLock write can fail silently and the scene lock stays stuck at LockModePublishing, blocking every later mutation on that scene (layer/property/style edits, further publishes, even deletion) until the next process restart.
Detaches the context before saving the lock, bounded by a short timeout, and logs the error instead of swallowing it. Same pattern already used elsewhere in this codebase for a status write that needs to survive a canceled parent context.
Added a regression test that fails without the fix (SaveLock receiving an already-canceled context) and passes with it.