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(ext/http): don't create abort signal during request abort #23581

Closed
wants to merge 2 commits into from

Conversation

littledivy
Copy link
Member

@littledivy littledivy commented Apr 27, 2024

request[_signal] will always create a new signal if there isn't one. It seems this check should use _signalCache instead? cc @mmastrac

@@ -592,8 +592,8 @@ const signalAbortError = new DOMException(
);
ObjectFreeze(signalAbortError);

function abortRequest(request) {
if (request[_signal]) {
function abortRequest(request, createNew = false) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this won't work either. Most likely we'll need to set some sort of semaphore in the signal cache to state that any signal created here needs to be aborted on creation.

Something like if (request[_signalCache] === undefined) { request[_signalCache] = false } else { request[_signalCache][signalAbort](signalAbortError); }. In the signal getter, we should check request[_signalCache] === false

@littledivy littledivy closed this Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants