[PHP] Stop pull-db cleanly during database apply - #582
Closed
adamziel wants to merge 1 commit into
Closed
Conversation
Contributor
Pull pipeline performance —
|
| Stage | PR | trunk | Δ | Status | Details |
|---|---|---|---|---|---|
playground-sqlite-db-pull |
9.91 s | 9.70 s | ⚪ +212 ms (+2.2%) | ✓ | 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 trunk: 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.77 s | 3.75 s | ⚪ +21 ms (+0.6%) | ✓ | 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 trunk: 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.69 s | 13.46 s | ⚪ +232 ms (+1.7%) |
Numbers carry runner noise; treat single-run deltas as directional, not authoritative.
📈 Trunk performance history — commit-by-commit timeline.
adamziel
force-pushed
the
codex/resume-database-pull-apply
branch
from
August 13, 2026 23:04
1f9c724 to
d21fd7d
Compare
adamziel
force-pushed
the
codex/resume-database-pull-apply
branch
from
August 14, 2026 02:14
461d802 to
44f6d47
Compare
adamziel
changed the base branch from
trunk
to
codex/db-apply-confirmed-replay
August 14, 2026 02:14
This was referenced Aug 14, 2026
adamziel
force-pushed
the
codex/db-apply-confirmed-replay
branch
from
August 14, 2026 12:48
0973ff7 to
e562106
Compare
adamziel
force-pushed
the
codex/resume-database-pull-apply
branch
from
August 14, 2026 12:49
44f6d47 to
c77fa57
Compare
adamziel
force-pushed
the
codex/db-apply-confirmed-replay
branch
from
August 14, 2026 12:53
e562106 to
2b6e97c
Compare
adamziel
force-pushed
the
codex/resume-database-pull-apply
branch
from
August 14, 2026 12:53
c77fa57 to
12d65b5
Compare
adamziel
force-pushed
the
codex/db-apply-confirmed-replay
branch
from
August 14, 2026 12:58
2b6e97c to
696367f
Compare
adamziel
force-pushed
the
codex/resume-database-pull-apply
branch
from
August 14, 2026 12:58
12d65b5 to
cfae355
Compare
Collaborator
Author
|
Closing this draft. It is being replaced by a smaller target-database checkpoint stack. |
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.
pull-dbnow handles SIGINT and SIGTERM while it is applying the database, exits with code 2, and leaves the database-apply stage unfinished for the next process.Background
The wrapper kept its normal signal handler while
db-applywas running. A signal could therefore kill the process during an active PDO query. Ifdb-applyreturnedpartial, the wrapper also called it again immediately in the same process.This change
The wrapper uses the database-apply signal policy only for that stage and restores its normal policy afterward. Pending signals are handled between SQL chunks, not during a target query.
db-applyruns once per wrapper process. A partial result sets exit code 2 and returns without marking the stage or the whole pull complete. The next process uses #595 to startdb.sqlagain from the beginning.This is PR 4 of 5: #590 → #591 → #595 → #582 → #607.
Testing
The focused PHP tests cover the partial result, next-process completion, restoration after an exception, and the actual PCNTL handlers and signal mask. The MySQL E2E blocks a target query, sends SIGTERM, checks exit code 2 and the unchanged stage, then completes the pull in a new process.