Repository navigation
Add after_child_ready hook - #220
Merged
hmcguire-shopify merged 1 commit intoNov 19, 2026
Merged
Conversation
byroot
reviewed
Oct 29, 2026
serenaf
force-pushed
the
serena/after-mold-ready-hook
branch
from
October 29, 2026 11:02
ac72c45 to
04dbb2f
Compare
byroot
approved these changes
Oct 29, 2026
byroot
left a comment
Contributor
There was a problem hiding this comment.
LGTM. cc @hmcguire-shopify
byroot
reviewed
Oct 29, 2026
serenaf
force-pushed
the
serena/after-mold-ready-hook
branch
from
October 29, 2026 12:14
04dbb2f to
26ea8a8
Compare
byroot
reviewed
Oct 29, 2026
| @monitor = nil | ||
| @exiting = false | ||
| @requests_count = 0 | ||
| @spawned_at = Pitchfork.time_now |
Contributor
There was a problem hiding this comment.
We just experimented with this in production, it works well for workers, but for molds the timing seem very off, I'll try to figure it out.
serenaf
force-pushed
the
serena/after-mold-ready-hook
branch
3 times, most recently
from
November 19, 2026 10:04
261f4f8 to
a0ff9e0
Compare
Contributor
|
cc @rafaelfranca no rush, but this patch would be very nice to have for us (allow to instrument boot time and worker spawn time more cleanly). |
Also persist Worker#spawned_at across restarts and preserve the initial mold's spawned_at record. Co-authored-by: Jean Boussier <jean.boussier@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
serenaf
force-pushed
the
serena/after-mold-ready-hook
branch
from
November 19, 2026 17:35
a0ff9e0 to
f2dcb51
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.
Adds an after_child_ready hook, called in the monitor whenever a worker, service or mold reports ready. Outdated molds discarded by the monitor don't trigger it.
Also exposes Worker#spawned_at so the hook can measure child boot time.
Use case: emitting a metric when a new mold successfully finishes loading the app.