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

Unable to send large files #317

Closed
kinegg opened this issue May 10, 2021 · 13 comments
Closed

Unable to send large files #317

kinegg opened this issue May 10, 2021 · 13 comments
Labels
bug Something isn't working external This relates to an external issue

Comments

@kinegg
Copy link

kinegg commented May 10, 2021

Using:

    await send(context, path, {
            root: `${Deno.cwd()}`,
            index: "index.html",
    })

Locally it works fine. But over a slow-ish line, curl and wget on that file hangs after about 128KB. I can see curl receives the correct content length, but it hangs around 50% forever.

The same problem occurs if I use context.response.body = Deno.readTextFileSync(path)

It's not a system or network problem, because I can repeatedly download the file just fine if I use python3 -m http.server, while with Deno it consistently fails if the file is too large.

@kitsonk
Copy link
Collaborator

kitsonk commented May 10, 2021

What version of Deno are you using? What does your command line look like? How big is the file you are trying to send?

@kinegg
Copy link
Author

kinegg commented May 10, 2021

Version is 1.8.1 as latest has issues (see other issue I posted).

The command line is denon run --reload --unstable --allow-env --allow-net --allow-read --allow-write server.ts

The file is 300KB, but anything above 128KB-ish gets stuck. Using https.

@kitsonk
Copy link
Collaborator

kitsonk commented May 10, 2021

oak 7.4.0 requires Deno 1.9.2 or later. Please try Deno 1.9.2.

Also, can you test without HTTPS/TLS and see if it resolves the issue, as it may actually be something upstream in how Deno handles those connections?

@kitsonk
Copy link
Collaborator

kitsonk commented May 11, 2021

Considering you are using TLS, I believe you were encountering the issue in Deno, which was resolved here: denoland/deno#10146. Deno 1.10.0 should be available within the next 24 hours and hopefully will resolve this issue.

@kitsonk kitsonk added bug Something isn't working external This relates to an external issue labels May 11, 2021
@kinegg
Copy link
Author

kinegg commented May 11, 2021

That looks likely yeah, thanks. I will close this issue if 1.10 solves the problem.

@Arcitec
Copy link

Arcitec commented May 13, 2021

@kinegg Please let us know how it goes, I am very very curious.

@Arcitec
Copy link

Arcitec commented May 13, 2021

Actually @kitsonk I just noticed that deno almost reverted that fix yesterday:

denoland/deno#10595

They then reopened a bunch of issues, and said that it was an issue in deno std not in the tcp handling.

And then they actually closed the "revert" pull request, didn't revert it after all, re-closed the issues, saying "false alarm":

denoland/deno#10595 (comment)

Example of comment in re-closed issue:

denoland/deno#9692 (comment)

I have no idea what is going on. But looks like they're fixing it, whatever was broken...

If I was to guess, they did the tcp fix, then they thought "maybe that wasn't broken", then realized "yeah it was broken" and didn't revert it after all.

@kitsonk
Copy link
Collaborator

kitsonk commented May 13, 2021

@Bananaman I am on the core team and was involved in the conversations. It should be fixed in Deno 1.10.1.

@Arcitec
Copy link

Arcitec commented May 13, 2021

@kitsonk Ahhh thanks for clarifying! Hope to hear if this fix helps @kinegg.

@Arcitec
Copy link

Arcitec commented May 24, 2021

@kitsonk Hi, the fixed version is released. Could you please check if this fixes the bug? :)

@kitsonk
Copy link
Collaborator

kitsonk commented May 24, 2021

It would be great if the OP checked if it fixed the bug... 😄

@kitsonk
Copy link
Collaborator

kitsonk commented Jun 14, 2021

Closing due to inactivity.

@kitsonk kitsonk closed this as completed Jun 14, 2021
@kinegg
Copy link
Author

kinegg commented Dec 7, 2021

It would be great if the OP checked if it fixed the bug... 😄

Haven't had time to check until now. The issue is fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external This relates to an external issue
Projects
None yet
Development

No branches or pull requests

3 participants