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

[core-http] abortSignal not able to abort download stream #12029

Closed
jeremymeng opened this issue Oct 23, 2020 · 0 comments · Fixed by #12038
Closed

[core-http] abortSignal not able to abort download stream #12029

jeremymeng opened this issue Oct 23, 2020 · 0 comments · Fixed by #12038
Assignees
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library.

Comments

@jeremymeng
Copy link
Member

using code similar to following to download a big file then abort the operation

        const aborter = new AbortController();
        const res = await blobClient.download(0, undefined, {
          abortSignal: aborter.signal,
        });
        console.log(`download call returned`);

        const stream = res.readableStreamBody;

        stream.on("close", () => {
          console.log(`stream closed`);
        });
        stream.destroy();
        aborter.abort();

Expect:
The underlying download stream should also get destroyed.

Actual:
The download stream is still receiving data. This can be verified by running netstat --tcp and see the connection to Azure Blob is still in ESTABLISHED state, and Recv-Q indicates incoming data.

Looking at our core-http code, we pass a abortSignal to node-fetch, however, after we got response back, we removed the listener. It seems an issue to me, as we would want to the ability to cancel the underlying download stream.

@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Oct 23, 2020
@jeremymeng jeremymeng added Azure.Core Client This issue points to a problem in the data-plane of the library. labels Oct 23, 2020
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Oct 23, 2020
@ramya-rao-a ramya-rao-a added this to the Backlog milestone Oct 23, 2020
@jeremymeng jeremymeng self-assigned this Nov 17, 2020
@jeremymeng jeremymeng modified the milestones: Backlog, MQ-2020 Nov 17, 2020
@ramya-rao-a ramya-rao-a modified the milestones: MQ-2020, [2021] February Dec 23, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants