Restrict import resume and abort to the unfinished lifecycle owner - #430
Open
adamziel wants to merge 8 commits into
Open
Restrict import resume and abort to the unfinished lifecycle owner#430adamziel wants to merge 8 commits into
adamziel wants to merge 8 commits into
Conversation
Contributor
Pull pipeline performance —
|
| Stage | Wall time | Resume attempts | Status | Details |
|---|---|---|---|---|
playground-sqlite-db-pull |
9.47 s | 1 | ✓ | condition=db-pull in PHP.wasm runtime=php.wasm 8.3 wp_mysql_parser=enabled mode=lexer native_lexer=verified native_token_stream=WP_MySQL_Native_Token_Stream native_token_count=18 native_parser=selected |
playground-sqlite-db-apply |
3.61 s | 1 | ✓ | condition=db-apply to SQLite in PHP.wasm runtime=php.wasm 8.3 wp_mysql_parser=enabled mode=parser native_lexer=verified native_token_stream=WP_MySQL_Native_Token_Stream native_token_count=18 native_parser=verified native_ast=WP_MySQL_Native_Parser_Node sqlite_driver_parser=verified |
| Total | 13.07 s |
Numbers carry runner noise; treat single-run deltas as directional, not authoritative.
📈 Trunk performance history — commit-by-commit timeline.
Admit resumable commands immediately after loading state so only the exact unfinished owner can resume or abort. Save reset state before checked transient-artifact cleanup, and make fresh file and database downloads replace stale outputs.
Reset the prior partial marker before each database index attempt so a completed response can advance the command. Update the MySQL E2E assertion to keep fresh downloads from restoring stale SQL buffers.
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.
An import command now resumes or aborts only its own lifecycle, and a completed command cannot clear another pipeline's state or artifacts.
Background
The unfinished owner controls admission while work can still resume. Completion removes that owner, but the final lower-level checkpoint still needs to identify the user-facing lifecycle that produced it.
started_by_commandrecords that provenance independently.This change
Admission runs immediately after state loading, before work-option validation, tuning, preflight, authentication, or network I/O. An unfinished
pull,pull-files, orpull-dbpipeline owns its lower-level checkpoint. Otherwise, anin_progressorpartialdirect checkpoint owns the lifecycle. Rejections name the exact resume and abort commands.All eight resumable commands use one ownership map for state and artifacts. Collision protection uses the completed checkpoint's full
started_by_commandscope instead of the final lower-level command's scope. A legacy completed checkpoint without that field rejects an overlapping abort and names the exact lower-level abort to run first; it no longer reports success while retaining ambiguous state.File aborts replay the remote-index WAL and retain downloaded files plus
pull/remote-index.jsonl. Database download aborts remove the SQL dump, table index, domain list, SQL buffer, and statistics, whiledb-applykeeps its inputs and external target unchanged.A fresh direct command first persists
artifact-cleanup, so interruption or removal failure repeats cleanup on the next invocation. Cleanup then advances tofresh-initialization; the first work phase is not exposed until command-specific state is saved with it. In particular,db-applypersists its URL rewrite map before a later invocation can enter the resume path.High-level aborts continue to force the established
{type:"lifecycle", event:"aborted", command:...}JSON record. Direct aborts force their{status:"aborted", message:...}record so throttling cannot hide either result.Testing
The Import suite covers the ownership matrix, completed starter-scope collisions, legacy checkpoint abort instructions, interruption at both fresh-start phases, durable database rewrite configuration, cleanup through a real local endpoint, and both abort output contracts.