Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#2364): concurrent aborts #3005

Merged
merged 2 commits into from
Mar 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refactor: wording
metcoder95 authored Mar 27, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 9d371aba7bc4a2e2048a3dbac9ab0700ad6e4c70
10 changes: 5 additions & 5 deletions lib/dispatcher/client-h2.js
Original file line number Diff line number Diff line change
@@ -391,11 +391,11 @@ function writeH2 (client, request) {
const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers
request.onResponseStarted()

// due to the stream nature, it is possible we face a race condition
// were stream has been assigned, but the request has been aborted
// the request stills in-flight and header's hasn't been processed yet
// for those scenarios, best case is to destroy the stream immediately
// as there's no value to keep it alive.
// Due to the stream nature, it is possible we face a race condition
// where the stream has been assigned, but the request has been aborted
// the request remains in-flight and headers hasn't been received yet
// for those scenarios, best effort is to destroy the stream immediately
// as there's no value to keep it open.
if (request.aborted || request.completed) {
const err = new RequestAbortedError()
errorRequest(client, request, err)