The one promise with no measurement: an execution survives the death of its process - #283
Open
gplanchat wants to merge 1 commit into
Open
The one promise with no measurement: an execution survives the death of its process#283gplanchat wants to merge 1 commit into
gplanchat wants to merge 1 commit into
Conversation
…ted it The parity note's line 1.2 says this is the only fundamental promise of the product with no measurement behind it, and it is right: every bench here runs in one process. The in-memory runner replays for real, but a single process cannot tell a journal from a leaked static — both survive a replay, and only one survives a SIGKILL. So: two OS processes sharing nothing but a SQLite journal. The first runs the first activity, is killed between the two awaits, and the second finishes the job. It returns what an uninterrupted run returns, and the first activity is never paid for twice. This is the bare bench, without the agent maquette, and that is the point. It is the discriminant: green here and red with the agent means the leak is in the maquette's ~4 100 lines; red here would have meant the core, and the whole parity plan stopping. It is green. Teeth checked by mutation, by hand: pointing the second process at an empty journal makes the first activity run twice, and the assertion falls. Deliberately out of scope, and noted in the slice: a worker killed *while* an activity is in flight. That leaves a scheduled slot with no outcome, and what should answer it is a redelivery — a property of the transport and its retry policy, neither of which this bare setup has. Measured on the way here, it waits forever, which is correct for a runtime with nobody to ask. Different question, and it deserves its own bench rather than a footnote in this one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
What this closes
The Durable/LangGraph parity note ranks its own inventory by what has to be true before anything else is worth building, and line 1.2 sits at the top: interprocess crash recovery — never tested; the bench runs in a single process. It is the product's central promise and the only one with no measurement behind it. Every other bench in this repository runs in one process, and a single process cannot tell a journal from a leaked static: both survive a replay, and only one survives a
SIGKILL.What it does
Two real OS processes sharing nothing but a SQLite journal file.
SIGKILLs itself between the twoawaits — the instant where the journal holds the first outcome and knows nothing of the second.It asserts that B returns what an uninterrupted run returns, and that the first activity appears exactly once in the shared log. It was run by a process that no longer exists, and B was served its result by the journal rather than paying for it again.
SIGKILLand notexit(): no destructors, no shutdown functions, no chance to flush anything a real crash would have taken. The slice is anexec()ed script and not afork()inside PHPUnit, because a fork shares the parent's memory image — which is exactly the class of leak this is looking for.The verdict, and what it buys
Green. Per the bifurcation the note wrote before the measurement: the bare bench passing means that if the agent maquette later fails the same shape, the leak lives in the maquette's ~4 100 lines and the parity plan survives whole. Red here would have meant the core, and the plan stopping. It is green, so the plan stands.
Teeth
Checked by mutation, by hand rather than by a second test: point process B at an empty journal and the first activity runs twice,
['bench.first', 'bench.first', 'bench.second']against the expected['bench.first', 'bench.second']. The assertion falls, so it is measuring what it claims to.Deliberately out of scope
A worker killed while an activity is in flight. That leaves a scheduled slot with no outcome, and what should answer it is a redelivery — a property of the activity transport and its retry policy, neither of which this bare setup has. Measured on the way here: with no transport worker and
maxActivityRetries: 0, resuming such an execution waits forever, which is the correct behaviour for a runtime that has nobody to ask. It is a real question and it deserves its own bench, not a footnote in this one.Notes for review
DbalEventStoreConformanceTest, with apathinstead ofmemory.posixorpdo_sqliteis missing.php-cs-fixerandphpstanclean on the three new files.