Skip to content

serve hangs on multiple TCP connections sending request data out-of-order #1

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

Open
Spiffyk opened this issue Feb 1, 2025 · 0 comments · May be fixed by #2
Open

serve hangs on multiple TCP connections sending request data out-of-order #1

Spiffyk opened this issue Feb 1, 2025 · 0 comments · May be fixed by #2

Comments

@Spiffyk
Copy link

Spiffyk commented Feb 1, 2025

Hi, I have found a bug as described in the title. The serve command hangs when a client attempts to open multiple connections and decides to send requests out-of-order, which actually seems be the behavior of real web browsers when dealing with multiple calls to the window.fetch(...) JS function. I can reproduce it with both the latest Firefox and Chromium.

This "httptest" repository is a simple reproducer - just clone it, serve it, and open the served index.html in a browser. It just runs the fetch() function on 10 files filled with zeroes. When everything loads, a paragraph should pop up saying Loaded all.. In the current main it stays on Loading... indefinitely.

I have a fix ready using epoll to make the TCP accept and the actual serving asynchronous relatively to each other, but that limits the serve command to Linux, so it's probably not usable as-is? I can open a PR nevertheless, if desirable.

@Spiffyk Spiffyk linked a pull request Apr 16, 2025 that will close this issue
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 a pull request may close this issue.

1 participant