Closed Bug 358387 Opened 20 years ago Closed 18 years ago

Synchronous XHR + DOMContentLoaded + big document = dead lock

Categories

(Core :: Networking: HTTP, defect)

defect
Not set
critical

Tracking

()

RESOLVED FIXED

People

(Reporter: apeller, Unassigned)

References

()

Details

This was reported as a problem against the Dojo 0.4 release which employs synchronous XHRs and uses DOMContentLoaded instead of window.onload to speed up page loading. http://trac.dojotoolkit.org/ticket/1640 Ths problem can be reproduced at this URL, which uses synch XHRs in the Dojo bootstrap: http://dojotoolkit.org/~jburke/dj4/dojo/tests/hang/hang.html Or by using the sample non-Dojo snippet included in Dojo ticket #1640 submitted by arnaud.andrillon@knowesia.fr: <html> <head> <script src="dojo/dojo.js.uncompressed.js"></script> <script> function docLoaded() { var http = dojo.hostenv.getXmlhttpObject(); http.open('GET',"document.xml", false); alert("Calling sync XMLHttpRequest - it's gonna freeze ..."); http.send(null); alert("Well, i guess they've fixed it, response (first fragment ) is " + http.responseText.substring(0, 255)); } if (document.addEventListener) document.addEventListener("DOMContentLoaded", docLoaded, false); </script> </head> <body> <img src="img/Sunset.jpg" width="100" /> <img src="img/Sunset1.jpg" width="100" /> <img src="img/Sunset2.jpg" width="100" /> <img src="img/Sunset3.jpg" width="100" /> <img src="img/Sunset4.jpg" width="100" /> </body> </html> The workarounds are ugly - one proposed workaround was to prevent images from loading by removing src attributes from img during loading and put them back after loading.
Component: General → Networking: HTTP
Product: Firefox → Core
Version: 1.5.0.x Branch → Trunk
This sounds like a duplicate bug of one that was fixed by thread manager. Synchronous XHR is nearly useless in Gecko 1.8 and earlier. Have you tested trunk builds? This should be far less of an issue since thread manager landed.
QA Contact: general → networking.http
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061027 Minefield/3.0a1 ID:2006102704 [cairo] URL WFM on current trunk nightly.
Hey Darin. Looks terrific in the trunk! How can we get this code into 2.0? (I won't even try to ask for 1.5, eh? :-)
The code to fix this was too big a change to port to the 2.0 branch. Don't worry, there's life after 2.0 too.
There is a new URL to use for testing this bug (the URL listed above it no longer available): http://download.dojotoolkit.org/release-0.4.0/dojo-0.4.0-ajax/tests/loader/1640/hang.html
Using this URL to test: http://download.dojotoolkit.org/release-0.4.0/dojo-0.4.0-ajax/tests/loader/1640/hang.html This appears to be fixed in Firefox 3 beta 3. Tested with: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9b3) Gecko/2008020511 Firefox/3.0b3
Marking fixed per above comments.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
No bug / patch referenced as the fix. -> WORKSFORME
Resolution: FIXED → WORKSFORME
As mentioned in comment 1, this was fixed by bug 326273
Resolution: WORKSFORME → FIXED
You need to log in before you can comment on or make changes to this bug.