-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Server stops handling requests when requesting many files during initial startup #5448
Closed
7 tasks done
Labels
Comments
What happens in the code is that
happily overwrites any existing _pendingReload with a new promise even though there might be current requests waiting for that _pendingReload to resolve. Thus the promise is never resolved for those clients and they remain waiting here
|
Would you like to work on a PR for this @Artur- ? |
Artur-
added a commit
to Artur-/vite
that referenced
this issue
Oct 27, 2021
In case of this call sequence 1. registerMissingImport 2. a new incoming request 3. registerMissingImport the request in step 2 will keep waiting indefinitely for a promise that will never resolve as step 3 overwrites the _pendingReload promise without resolving the previous one Fixes vitejs#5448
Artur-
added a commit
to Artur-/vite
that referenced
this issue
Oct 27, 2021
fix vitejs#5448) In case of this call sequence 1. registerMissingImport 2. a new incoming request 3. registerMissingImport the request in step 2 will keep waiting indefinitely for a promise that will never resolve as step 3 overwrites the _pendingReload promise without resolving the previous one Fixes vitejs#5448
9 tasks
Sure, I created #5452 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
When starting Vite in a given project, I see
Then if I load a file (
app-view.ts
) that imports a lot of other files and do that many times over using e.g.curl http://localhost:3004/VAADIN/src/app-view.ts
I see this in Vite
Requesting the same file again results in
and the third time it finds even some more dependencies
Now if I do not wait for the steps to complete but instead start Vite and then fetch the file as
then one of three things happens to each request:
Something unexpected happened while optimizing "/src/app-view.ts"<h1><p>The current page should have reloaded by now</p>
Might be that this does not cause problems in the browser as reloading the page cuts the request which are loading resources and the browser then tries again. However, in our setup we have a Java server between the browser and Vite (the Java server handles part of the application). The proxy will then be left with a lot of requests that are just hanging, waiting for Vite to respond. These requests then prevent other requests from being handled before the time out in the end as Vite never responds. If Vite just closed the connections, it would work fine.
Reproduction
Unfortunately the application where the problem reproduces cannot be shared and I have not been able to reproduce it in a standalone project. I am happy to debug it further if you have any pointers on how.
System Info
System: OS: macOS 11.6 CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Memory: 1.27 GB / 32.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 16.11.0 - /usr/local/bin/node Yarn: 1.22.11 - /usr/local/bin/yarn npm: 8.0.0 - /usr/local/bin/npm Watchman: 2021.10.04.00 - /usr/local/bin/watchman Browsers: Brave Browser: 93.1.29.81 Chrome: 95.0.4638.54 Chrome Canary: 97.0.4683.0 Firefox: 92.0.1 Safari: 15.0 Safari Technology Preview: 15.4 npmPackages: vite: ^2.6.4 => 2.6.13
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: