Closed Bug 751257 Opened 14 years ago Closed 14 years ago

Multiple XMLHttpRequest will fail with status code 0 (zero)

Categories

(Core :: General, defect)

12 Branch
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: ritchey.mulhollem, Unassigned)

References

()

Details

User Agent: Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20100101 Firefox/12.0 Build ID: 20120420145725 Steps to reproduce: Wrote javascript which fires off multiple asynchronous XMLHttpRequest threads to web server. Actual results: Some threads will fail with status code 0. Upon retrying the same request, it will succeed. The code only fails with Firefox V12. It works perfectly in V11. This bug appears related to: Bug 488605 Expected results: All threads should complete.
Built a demo webpage that demonstrates how badly Firefox fails: http://www.rthdata.com/demo.htm
Component: Untriaged → General
OS: Windows XP → All
Product: Firefox → Core
QA Contact: untriaged → general
Hardware: x86 → All
Hawk, thanks for pointing out that this fails in FF 12 but not FF 11; that's helpful. Do you think you could help us pinpoint the regression range by running http://mozilla.github.com/mozregression/ between the dates of 2011-11-08 and 2011-12-20?
Certainly! I should have some free cycles tonight. I'll track it down and let you know.
Found it! Build date 2012-01-27 is the first broken release. Build date 2012-01-26 is good. It appears to be a timeout issue on the socket. If it can't immediately connect, it gives up and returns status zero.
Thank you for that :) The bug that causes the change in behaviour is bug 525816, which adds support for the timeout attribute on async xmlhttprequests. It looks to me like this behaviour is working as intended, since the connection isn't complete by the time the timeout timer expires.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
I disagree. If this is true, then why is it returning a status code of 0 instead of the W3C approved status code of 408?? Refer to RFC 2616 section 10.4.9 Had it said "408" then I would have known what was going on. Having it return zero tells me nothing!! Zero to me, means BROKEN, not timeout!
> then why is it returning a status code of 0 The spec for what "status" should return is at http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#the-status-attribute and says: If the state is UNSENT or OPENED, return 0 and terminate these steps. If the error flag is set, return 0 and terminate these steps. Return the HTTP status code. The spec for what "timeout" does is at http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#timeout-error and step 3 of that is: Set the the error flag. So returning 0 after a timeout is what the spec calls for. If you think the spec should change, please send mail to public-webapps@w3.org
But note that in general, .status is supposed to reflect the status the _server_ returned. Any client-side failures get mapped to status=0, with events notifying you about what actually happened.
You need to log in before you can comment on or make changes to this bug.