Repository navigation
Preserve worker spawn deadlines in the mold - #233
Merged
Merged
Conversation
rafaelfranca
marked this pull request as draft
November 18, 2026 22:46
This was referenced Nov 18, 2026
rafaelfranca
marked this pull request as ready for review
November 18, 2026 23:23
Member
Author
|
hmmm. This fix the problem, but it is weird fix. The problem was identified correctly, but I feel like having a conditional on the state drop just because it is shared with the model is strange. @byroot what do you think? I'd instead remove |
Contributor
|
Yeah, it all comes down to a design choice inherited from Unicorn, that the I agree that no longer automatically calling |
The monitor sets a spawn deadline before it asks the mold to fork. The mold creates another Worker and resets the same shared state. This can clear the deadline and prevent the monitor from abandoning a slow spawn. Keep the shared state in the mold. Synchronize the timeout test so that it covers the race.
Worker initialization receives a flag to distinguish the monitor from the mold. The flag spreads process-specific behavior across the worker creation paths. Attach shared state during initialization, and reset it explicitly when the monitor creates a worker or service. The mold can then attach to the same state without resetting the spawn deadline.
rafaelfranca
force-pushed
the
ci-fixes/worker-timeout
branch
from
November 19, 2026 16:01
01be78e to
4c366e4
Compare
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.
Problem
The monitor sets a spawn deadline before it asks the mold to fork.
The mold then creates a
Workerand resets the same shared state.This can clear the deadline, so the monitor can miss a spawn timeout.
The service worker uses the same pattern.
This issue relates to #210.
Solution
Keep the shared state when the mold creates a worker or service worker.
Synchronize the existing timeout test so that it covers this race.
Verification
TestInfo#test_close_all_ios_except_marked_ones.