deno
39de6af7 - fix(ext/fetch): don't leak op_fetch_response_closed on body teardown

Commit
102 days ago
fix(ext/fetch): don't leak op_fetch_response_closed on body teardown The closed-watcher op held a strong Rc to the FetchResponseResource (via the cancel handle), which kept the resource — and its background reader task — alive until the op completed. When a body was cancelled/aborted before it finished (e.g. a hanging upstream body, as in the httpServerCancelFetch test) the op never observed a terminal status and leaked, tripping the async-op sanitizer. Release the resource handle in `closed()` after extracting the shared state, and have `BodyReader::drop` mark a terminal status and wake any `closed` waiter so the op completes when the resource is torn down. Co-Authored-By: Divy Srivastava <me@littledivy.com>
Author
Parents
Loading