Repository navigation
STOR-5760: Report an onHibernate handler's onset to tail workers - #8125
Conversation
There was a problem hiding this comment.
Superseded by the review of
38db8750.
This review, of dd329b85
💬 Approved with comments — The onset and return reporting is correct and follows the existing [restore] and alarm patterns. The only comment is optional: the test could also check the return event and the canceled path.
Findings: 1 suggestion
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
📋 Code Quality: 💬 1 suggestion
The onset and return reporting is correct. The new test checks only the onset.
Recommendation: 💬 Optional Nits
- [SUGGESTION] The new test checks the
CustomEventInfoonset but not the return event, and it doesn't cover a canceled handler, which should report no return. Both behaviours are stated in the description. (src/workerd/io/incoming-request-test.c++:667)
View full review
Production change checked, no defects found
- The
CustomEventInfoonset is set right after theIncomingRequestis constructed, before the handler is delivered. That's the order the streaming tail writer requires. setReturn(context.now())runs only on the settled path, afterreported = true. A canceled handler goes through theKJ_DEFERpath and reports no return, as the description says.- A handler that throws still gets a return, because execution leaves the
KJ_CATCHblock and reachessetReturn.
The test covers only part of the change (src/workerd/io/incoming-request-test.c++:646-669)
- The new test checks that
eventInfois aCustomEventInfo. It doesn't check that a return was recorded, or that a canceled handler records none. The description states both behaviours, so tests for them would guard against regressions.
✅ All other checks passed
📝 Documentation: ✅ LGTM
No documentation issues. The new code comments and the test name match what the change does.
Reviewed commit: dd329b85
dd329b8 to
38db875
Compare
There was a problem hiding this comment.
Superseded by the review of
37ef6316.
This review, of 38db8750
✅ Approved — No findings. The previous test-coverage suggestion is fixed, and the onset and return reporting follows the existing [restore] and alarm patterns.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
📋 Code Quality: ✅ LGTM
- Production change (
src/workerd/io/worker.c++):- The
CustomEventInfoonset is set right after theIncomingRequestis constructed and beforedelivered(). This is the order the streaming tail writer requires. setReturn(context.now())runs only on the settled path, afterreported = true. That path includes a handler that throws.- A canceled handler only goes through the
KJ_DEFERblock, so it reports no return.
- The
- Tests (
src/workerd/io/incoming-request-test.c++:647-720):- The settled test asserts
"customOnset;return;". - The canceled test drops a handler that never settles and asserts only
"customOnset;".
- The settled test asserts
📝 Documentation: ✅ LGTM
No documentation issues. The code comments and test names match what the change does.
Reviewed commit: 38db8750
38db875 to
37ef631
Compare
There was a problem hiding this comment.
Superseded by the review of
e088e80d.
This review, of 37ef6316
✅ Approved — No findings. The onset and return reporting follows the existing [restore] and alarm patterns, and the updated tests cover both the settled and the canceled handler.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
📋 Code Quality: ✅ LGTM
No findings.
- The
RecordingTracerinincoming-request-test.c++overrides every pure virtual ofBaseTracerwith matching signatures. - The settled-handler test expects
"customOnset;return;". That matches the onset being set beforedelivered()andsetReturnbeing called on the settled path inworker.c++. - The canceled-handler test drops the pending promise and expects only
"customOnset;". That matches a canceled handler leaving through theKJ_DEFERblock without reachingsetReturn.
📝 Documentation: ✅ LGTM
No documentation issues. The code comments and test names match what the change does.
Reviewed commit: 37ef6316
37ef631 to
e088e80
Compare
There was a problem hiding this comment.
Superseded by the review of
31941061.
This review, of e088e80d
✅ Approved — No findings. The onset and return reporting follows the existing [restore] and alarm patterns, and the updated tests cover both the settled and the canceled handler.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
📋 Code Quality: ✅ LGTM
No findings.
- The
RecordingTracerinincoming-request-test.c++overrides every pure virtual ofBaseTracerwith matching signatures. - The settled-handler test expects
"customOnset;return;". That matches the onset being set beforedelivered()andsetReturnbeing called on the settled path inworker.c++. - The canceled-handler test drops the pending promise and expects only
"customOnset;". That matches a canceled handler leaving through theKJ_DEFERblock without reachingsetReturn.
📝 Documentation: ✅ LGTM
No documentation issues. The code comments and test names match what the change does.
Reviewed commit: e088e80d — same changes as 37ef6316, so this is that commit's review (no new review was run; line numbers are as of 37ef6316)
runOnHibernate() accepts a tracer but never set the event's onset. A buffered tail worker got a trace with no event, and the streaming tail writer requires an onset before any other event, so no embedder could pass a tracer. Set a CustomEventInfo onset before the handler is delivered, as the [restore]() hook does, and mark the return once the handler settles, as runAlarm() does. A canceled handler reports no return.
e088e80 to
3194106
Compare
There was a problem hiding this comment.
✅ Approved — No findings. The onset and return reporting follows the existing [restore] and alarm patterns, and the updated tests cover both the settled and the canceled handler.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
📋 Code Quality: ✅ LGTM
No findings.
- The
RecordingTracerinincoming-request-test.c++overrides every pure virtual ofBaseTracerwith matching signatures. - The settled-handler test expects
"customOnset;return;". That matches the onset being set beforedelivered()andsetReturnbeing called on the settled path inworker.c++. - The canceled-handler test drops the pending promise and expects only
"customOnset;". That matches a canceled handler leaving through theKJ_DEFERblock without reachingsetReturn.
📝 Documentation: ✅ LGTM
No documentation issues. The code comments and test names match what the change does.
Reviewed commit: 31941061 — same changes as 37ef6316, so this is that commit's review (no new review was run; line numbers are as of 37ef6316)
Stacked on #8124.
Worker::Actor::runOnHibernate()takes a tracer but never set the event's onset. A buffered tail worker got a trace with no event, and the streaming tail writer asserts if no onset was reported, so an embedder couldn't pass a tracer at all.The handler now reports a
CustomEventInfoonset before it's delivered, the same as the[restore]()hook. It also reports a return once the handler settles, asrunAlarm()does. A canceled handler reports no return.Two new
incoming-request-testcases run a hook with a tracer. One checks that it reports aCustomEventInfoonset and then a return. The other checks that a canceled hook reports the onset and no return.