Repository navigation
STOR-5760: Let embedders set an onHibernate handler's trace - #8871
Conversation
There was a problem hiding this comment.
Superseded by the review of
d1529da8.
This review, of 475fd79b
✅ Approved — No issues found: the trigger context is passed through to the handler's IncomingRequest correctly, callers that pass none behave as before, and the new test covers the change.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🔒 Security: ✅ LGTM
No security concerns. The change only passes in trace context that the embedder supplies.
📋 Code Quality: ✅ LGTM
triggerContextis passed throughrunOnHibernate()andrunOnHibernateImpl()to theIoContext::IncomingRequestconstructor, in the slot that used to holdkj::none /* maybeTriggerInvocationSpan */.InvocationSpanContext::newForInvocation()takes the trace ID from the trigger context when one is passed. Withkj::noneit behaves as before.- The local server's caller (
worker-factory.c++) passeskj::none. - The new test passes a trigger context with a known trace ID and checks that the handler's invocation uses it.
📝 Documentation: ✅ LGTM
The updated header comment for runOnHibernate() describes the new parameter accurately.
Reviewed commit: 475fd79b
475fd79 to
d1529da
Compare
There was a problem hiding this comment.
Superseded by the review of
25b19676.
This review, of d1529da8
✅ Approved — No issues found. triggerContext is passed through to the handler's IoContext::IncomingRequest correctly, the local server passes kj::none and behaves as before, and the updated test and header comment match the code.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🔒 Security: ✅ LGTM
No security concerns. The change only passes in trace context that the embedder supplies. No trust boundary is crossed and no check is removed.
📋 Code Quality: ✅ LGTM
No issues found in the four changed files.
- Call sites: Both callers of
runOnHibernate()pass the newtriggerContextargument in the right position. The local server (worker-factory.c++) passeskj::none, and the test helper forwards the value it is given. - Trace ID path:
worker.c++passestriggerContexttoIoContext::IncomingRequestin the slot that used to holdkj::none. When a trigger context is given,InvocationSpanContext::newForInvocation()takes its trace ID from it. Withkj::noneit generates a fresh trace ID, as before. - Test: The updated test passes a known
TraceId, records the trace ID of the handler's invocation and checks that it matches.
📝 Documentation: ✅ LGTM
The updated header comment for runOnHibernate() in worker.h describes the triggerContext parameter accurately.
Reviewed commit: d1529da8
d1529da to
25b1967
Compare
There was a problem hiding this comment.
Superseded by the review of
954e9dfd.
This review, of 25b19676
✅ Approved — No issues found. triggerContext reaches the handler's IncomingRequest, the local server behaves as before, and the test covers the change.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🔒 Security: ✅ LGTM
No security concerns. The change only passes along trace context that the embedder supplies.
📋 Code Quality: ✅ LGTM
No issues found.
- Call sites: Every caller of
runOnHibernate()passes the new argument. The local server passeskj::none, and the test helper forwards the context it is given. - Trace path:
worker.c++forwardstriggerContexttoIoContext::IncomingRequestin themaybeTriggerInvocationSpanslot. The types match. - Test: The new case passes a known trace ID and checks it against the trace ID recorded at
setEventInfo(), which runs on the code path this change touches.
📝 Documentation: ✅ LGTM
The runOnHibernate() header comment in worker.h describes the triggerContext parameter accurately.
Reviewed commit: 25b19676
Worker::Actor::runOnHibernate() always started the handler's invocation in a trace that workerd chose. An embedder that starts a trace for the handler, as it does for the actor's other events, couldn't pass it in. The handler's spans and logs then carried a different trace ID from the one that its subrequests propagate. runOnHibernate() now takes the trace for the handler to run in, which it passes to the handler's IoContext::IncomingRequest as its trigger context. The handler still runs outside any request, so the embedder gives it a trace of its own. The local server passes none, so its handlers start their own traces as before.
25b1967 to
954e9df
Compare
There was a problem hiding this comment.
✅ Approved — No issues found. triggerContext reaches the handler's IncomingRequest, the local server behaves as before, and the test covers the change.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🔒 Security: ✅ LGTM
No security concerns. The change only passes along trace context that the embedder supplies.
📋 Code Quality: ✅ LGTM
No issues found.
- Call sites: Every caller of
runOnHibernate()passes the new argument. The local server passeskj::none, and the test helper forwards the context it is given. - Trace path:
worker.c++forwardstriggerContexttoIoContext::IncomingRequestin themaybeTriggerInvocationSpanslot. The types match. - Test: The new case passes a known trace ID and checks it against the trace ID recorded at
setEventInfo(), which runs on the code path this change touches.
📝 Documentation: ✅ LGTM
The runOnHibernate() header comment in worker.h describes the triggerContext parameter accurately.
Reviewed commit: 954e9dfd — same changes as 25b19676, so this is that commit's review (no new review was run; line numbers are as of 25b19676)
Worker::Actor::runOnHibernate()always started the handler's invocation in a trace that workerd chose. An embedder that starts a trace for the handler, as it does for the actor's other events, couldn't pass it in. The handler's spans and logs then carried a different trace ID from the one that its subrequests propagate.runOnHibernate()now takes the trace for the handler to run in, which it passes to the handler'sIoContext::IncomingRequestas its trigger context. The handler still runs outside any request, so the embedder gives it a trace of its own; it isn't nested under the request or alarm that last ran. The local server passes none, so its handlers start their own traces as before.The new
incoming-request-testcase checks that the handler's invocation uses the trace it's given, and fails without the change. Embedders that callrunOnHibernate()need updating for the new parameter.