qooxdoo / qooxdoo

qooxdoo - Universal JavaScript Framework
http://qooxdoo.org
Other
764 stars 259 forks source link

Parallel loading in browser causes network failure when including many class files #10649

Open WillsterJohnsonAtZenesis opened 4 months ago

WillsterJohnsonAtZenesis commented 4 months ago

Describe the bug

In one of our projects, there is an application which loads a little over 2000 (two thousand) class files, as well as several applications which load fewer (typically 1000-1600). The one with over 2000 cannot be loaded in Chrome, as the final 30 or so class files fail with the error net::ERR_INSUFFICIENT_RESOURCES.

Below is one example of this;

GET http://localhost:8080/_g/code/transpiled/path/to/Class.js net::ERR_INSUFFICIENT_RESOURCES
loadScript @ index.js:55669
flushScriptQueue @ index.js:55789
begin @ index.js:55561
init @ index.js:55575
(anonymous) @ index.js:55963

followed later by;

Cannot load script /_g/code/app/appname/../../transpiled/path/to/Class.js
elem.onerror @ index.js:55660
error (async)
loadScript @ index.js:55658
flushScriptQueue @ index.js:55789
begin @ index.js:55561
init @ index.js:55575
(anonymous) @ index.js:55963

To Reproduce Steps to reproduce the behavior:

  1. Create a project with 2000 classes (this may take some time)
  2. Serve the project
  3. open with Chrome (Safari, Firefox appear to have no issue loading)
  4. Observe the exceptions

Expected behavior The application ought to load

Desktop (please complete the following information):

Additional context

This can be avoided by appending the following query parameter to the application url, which disables parallel loading and loads classes at a pace Chrome is able to keep up with.

http://localhost:8080/application.html?qooxdoo:load-parallel=false

For MacOS (potentially Linux also), modifying the process limits and file limits in ulimit or by modifying .plist files achieves nothing in relation to this.

Interestingly, everyone else working on this application is using Chrome and is having no problem. My Mac is using an Intel processor, while they are using both M1 chips and Intel processors.

All things considered, we have absolutely no idea why this issue is appearing. It seems like it's okay in prod when everything is bundled, but in dev where it is not Chrome hits it's limit.

We've not tested this out on other OSes (only MacOS) or many browser versions (latest Chrome, Chrome Dev, Firefox, and Safari for Ventura 13.6.3 at the time of writing).