Conversation
There was a problem hiding this comment.
I'm Bonk, and I've done a quick review of your PR.
This decouples AbortSignal from IoContext by removing the per-signal IoOwn<RefcountedCanceler> member and creating per-use cancelers via newMaybeCrossContextCancelHandler. Findings ranked by severity:
- [HIGH] Missing
subscribeToRpcAbortcall innewMaybeCrossContextCancelHandler— RPC-deserialized signals won't fire the canceler - [HIGH] Missing already-aborted check in
maybeCancelWrap—scheduler.waitwith an already-aborted signal silently hangs instead of throwing - [MED] Fragile exception description string matching in
handleCancelablePump - [LOW] Stale
visitForMemoryInfoatbasics.h:702-707still tracksIoOwn<RefcountedCanceler>as an inline field, but thecancelermember was removed. Should remove thetrackInlineFieldWithSizeline. - [LOW] Typo: "non-op" should be "no-op"
This review was generated by an AI assistant and may contain inaccuracies. Please verify all suggestions before applying.
|
Review posted successfully. Here's a summary of the findings on PR #6273:
|
Co-authored-by: jasnell <jasnell@users.noreply.github.com>
9cda17d to
ffef7fe
Compare
Allow a AbortController/AbortSignal to be created outside of a request context, and allow cross-context aborts to work. In some ways this is a bit of a hack. When a native abort handler is added from one IoContext, and the abort is triggered from another IoContext, the, we have to arrange for the handler to trigger the actual kj::Canceler from the right IoContext. We do this using the same approach we use for cross-context promises: we abuse...er, use.. the DeleteQueue to schedule the canceler to trigger the next time the correct IoContext is entered.
ffef7fe to
66a9daa
Compare
Allow a AbortController/AbortSignal to be created outside of a request context, and allow cross-context aborts to work.
In some ways this is a bit of a hack. When a native abort handler is added from one IoContext, and the abort is triggered from another IoContext, the, we have to arrange for the handler to trigger the actual kj::Canceler from the right IoContext. We do this using the same approach we use for cross-context promises: we abuse...er, use.. the DeleteQueue to schedule the canceler to trigger the next time the correct IoContext is entered.
This needs to be reviewed very carefully!
I'm not likely to land this as is, I'll probably restore the original impl and add an autogate to switch between two different AbortSignal impls but I want to get an initial review on the approach before making those changes.