Synchronous AJAX calls cause entire browser to freeze until call completes

RESOLVED FIXED

Status

()

--
major
RESOLVED FIXED
9 years ago
8 years ago

People

(Reporter: rsimoes+ff_bugzilla, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [CLOSEME 2011-1-1], URL)

(Reporter)

Description

9 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5 (.NET CLR 3.5.30729)

When making synchronous ajax calls, Firefox becomes unresponsive until the call completes. This was not the case in 3.0.x. A demonstration can be found at http://www.richardsimoes.com/sjax/ . In it, sjax calls are being made every two seconds to a file. The file is a CGI script with a 0.5-second sleep, following by a single print line. To see the bug in action, attempt type something in the text box.

Reproducible: Always

Steps to Reproduce:
1. Make synchronous ajax call
2. Attempt to do anything in the browser.
Actual Results:  
Keystrokes will be ignored, tab-changing will briefly stop functioning, etc.

Expected Results:  
Normal functionality
(Reporter)

Updated

9 years ago
OS: Windows XP → Windows 7

Comment 1

9 years ago
Well, that's the reason why you shouldn't normally use synchronous calls, unless you absolutely need them.

http://hacks.mozilla.org/2009/07/synchronous-xhr/

see bug 340345 and (especially) bug 333198
(Reporter)

Comment 2

9 years ago
Thanks, but your comment is unhelpful. I'm well aware of the drawbacks regarding synchronous calls. What I'm reporting is a *new, undesirable behavior* (a bug, if you will) in Firefox not exhibited in stable releases prior to 3.5.

Comment 3

9 years ago
that was done in bug 333198
(Reporter)

Comment 4

9 years ago
That bug concerns input events not firing, not the entire browsing becoming unresponsive.

Comment 5

9 years ago
There is currently a single thread for all GUI related tasks (there are other threads in use, but one is the main one), so the entire GUI will appear to hang. That explains why a single tab can block other tabs, and it also explains why a synchronous XHR request will appear to hang the rest of the browser.

Like mentioned in the url above, "Outside of worker threads, synchronous XHR is the spawn of Satan."

There are attempts to fix this, but they're way off. In the mean time, you might want to look into Workers Threads <https://developer.mozilla.org/En/Using_DOM_workers>.

Comment 6

9 years ago
I have experienced this bug since 3.5 in both XP, Vista, Win7 and Mac OS X.
The whole browser becomes unresponsive during ajax calls which is very bothering.
Reporter, are you still seeing this issue with Firefox 3.6.12 or later in safe mode? If not, please close. These links can help you in your testing.
http://support.mozilla.com/kb/Safe+Mode
http://support.mozilla.com/kb/Managing+profiles
Also, please consider using the most recent Firefox 4 beta build, your bug may be resolved there.
Whiteboard: [CLOSEME 2011-1-1]
(Reporter)

Comment 8

8 years ago
Keystrokes are still being ignored, but that has a separate ticket for it.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.