Repository navigation
Conversation
|
Since last review: 0 resolved, 1 still open, 0 new. Adds completion-capability plumbing for buffered and streaming tail RPC delivery. Reviewed commit: 8c5586cc · github run |
There was a problem hiding this comment.
[WARNING] For an actor used as a dynamic tail target, another request can arrive while this tail handler or its event.waitUntil() work is still running. delivered() then fulfills this request's drainFulfiller, so drain() completes and destroys the attached capability, but actor waitUntil work remains in the shared IoContext task set for the newer request. The sender therefore observes completion before the handler's work has finished, contrary to the new completion contract. Keep the capability with per-event work that survives actor-request handoff, or reject actor tail targets until that lifetime can be represented.
09c712d to
cba0d22
Compare
cba0d22 to
ae67da6
Compare
EventDispatcher.sendTraces() returns as soon as the trace handler has been queued as a waitUntil task, before it has waited for its isolate lock or run. tailStreamSession() returns once the session completes, while the handler's waitUntil() work may continue. A caller therefore cannot tell how long the receiver keeps working on its traces. Add an optional `completion` capability to both calls, of a new empty TraceCompletion interface. The receiver attaches it to the handler's IncomingRequest, so it is released once that request drains: the handler and its background work finish, time out, or abort. TraceCustomEvent and TailStreamCustomEvent carry the capability, and forward the same one when they send the event over RPC. A receiver that predates the field ignores it, releasing it on arrival. For an actor receiver, a later request takes over the actor's background work, and the earlier request stops draining. The capability can then be released while the handler's work continues.
ae67da6 to
8c5586c
Compare

EventDispatcher.sendTraces() returns as soon as the trace handler has been queued as a waitUntil task, before it has waited for its isolate lock or run. A caller therefore cannot tell how long the receiver keeps working on its traces.
Add an optional
completioncapability to sendTraces(), of a new empty TraceCompletion interface. The receiver attaches it to the handler's IncomingRequest, so it is released once that request drains: the handler and its background work finish, time out, or abort. TraceCustomEvent carries the capability, and forwards the same one when it sends the event over RPC. A receiver that predates the field ignores it, releasing it on arrival.