Prevent late platform action writes from recreating deleted Actions databases - #19776
Open
jvcalderon wants to merge 10 commits into
Open
jvcalderon wants to merge 10 commits into
jvcalderon wants to merge 10 commits into
Conversation
jvcalderon
marked this pull request as ready for review
September 30, 2026 14:35
jvcalderon
added this pull request to stack #19741
September 30, 2026 14:39
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 14 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
This branch has not been deployed
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.
Description
Fixes the deletion race raised in #19724 review: an in-flight platform action event or a queued session-index job could recreate a workspace's dedicated Actions database after the workspace was deleted, because CouchDB creates missing databases on write.
The fix pairs a lock with an existence check. Either one alone still leaves a race.
LockName.PLATFORM_ACTIONS_WORKSPACE, keyed by the prod workspace ID as a system lock. Dev and prod writers, workspace deletion and tenant deletion all contend for the same key, whatever tenant is in context.Scope and known limitations:
Tests cover both orderings (writer first and deletion first), late events, late session jobs (action and lifecycle-only), dev/prod lock identity, per-workspace lock isolation, tenant deletion running only inside each workspace's lock, and Actions preservation on unpublish.
Addresses
Launchcontrol
Prevents activity logs from reappearing after a workspace or tenant is deleted.
Summary by cubic
Fixes the race where late platform action writes, queued session-index jobs, or view creation could recreate a deleted workspace's Actions database, because CouchDB creates missing databases on write.
Bug Fixes:
Tests cover both orderings (writer vs. deletion), late events and jobs, lock renewal past the original TTL, dev/prod lock identity, per-workspace isolation, view creation during deletion, and Actions preservation on unpublish.
Written for commit dc1e72e. Summary will update on new commits.