MozillaZine

error on long lasting ajax calls

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
schulzki
 
Posts: 4
Joined: April 11th, 2015, 1:48 am

Post Posted April 11th, 2015, 3:04 am

Hi,

since FF V35, long lasting ajax requests are canceled with an error after a random amount of time.
The error is a status 404 but not a reply from the server.
With a processing delay of 100 Secs the error happens with >95% of the requests, with a high variance
(somtetimes after 10 secs, sometimes after 70 secs).

I tested ajax requests without lib support as well as jQuery.
I also checked different appserver versions (Jetty 6, 8, 9)

No error on FF <= Version 34 (also no error on other browsers).

Can sb. please verify this?

thx, schulzki

LoudNoise
Moderator

User avatar
 
Posts: 40048
Joined: October 18th, 2007, 1:45 pm
Location: Next door to the west

Post Posted April 11th, 2015, 9:00 am

Moving to Web Development to give those folks a look at this. Can you provide a link to something showing the problem?
Post wrangler
"Choose between the Food Select Feature or other Functions. If no food or function is chosen, Toast is the default."

trolly
Moderator

User avatar
 
Posts: 39878
Joined: August 22nd, 2005, 7:25 am

Post Posted April 11th, 2015, 11:21 am

To my knowledge 404 is a server side error.
http://en.wikipedia.org/wiki/HTTP_404
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.

jscher2000

User avatar
 
Posts: 10077
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA

Post Posted April 11th, 2015, 7:50 pm

I think if a high percentage of AJAX calls were randomly cancelled in Firefox 35-37, there would be a large volume of posts about it on Mozilla-related forums and on sites like StackOverflow. I can't recall seeing that.

Could it be something Jetty-specific?

LoudNoise
Moderator

User avatar
 
Posts: 40048
Joined: October 18th, 2007, 1:45 pm
Location: Next door to the west

Post Posted April 11th, 2015, 9:02 pm

As noted, a link to the problem would be welcomed.
Post wrangler
"Choose between the Food Select Feature or other Functions. If no food or function is chosen, Toast is the default."

schulzki
 
Posts: 4
Joined: April 11th, 2015, 1:48 am

Post Posted April 12th, 2015, 5:12 am

ok, here is some more info:

  • I can reproduce it with apache/PHP so it is not jetty.
  • The 404 is the status delivered in the ajax callback, however, the status reported on firebug network table is "aborted"
  • I don't have a link illustrating the problem in production (only integration), but it is very easy to reproduce if you have apache/PHP installed. I provide some code beneath

To reproduce the problem, you only need these 2 files.
The index.html provides a button that simply triggers an ajax request loading info.php, which delays the answer for 100sec.

index.html
Code: Select all
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>Ping WS</title>
    <script type="text/javascript">
   function debug(text){
      document.getElementById("debug").innerHTML = text;
   }
   
    function callAjax(url, success, error){
      var xmlhttp;
      xmlhttp = new XMLHttpRequest();
      xmlhttp.onreadystatechange = function(){
         if (xmlhttp.readyState == XMLHttpRequest.DONE ){
            if( xmlhttp.status == 200){
               success(xmlhttp.responseText);
            } else {
               error(xmlhttp.responseText);
            }
         }
      }
      xmlhttp.open("GET", url, true);
      xmlhttp.send();
   }

      function longping(){
            start = new Date().getTime();
         debug("long call...")
            callAjax(
                window.location.origin + "/info.php",
                function(){
               var dur = new Date().getTime() - start;
               debug("ok: " + dur);
            },
            function(e){
               var dur = new Date().getTime() - start;
               debug("ko: "  + dur);
            });
        };


    </script>
</head>
<body>
<button onclick="longping()">fire</button>
<div id="debug">debug</div>
</body>
</html>


info.php
Code: Select all
<?php

echo "waiting\n";

usleep(100000000);
?>

jscher2000

User avatar
 
Posts: 10077
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA

Post Posted April 12th, 2015, 10:38 am

Test page: http://jeffersonscher.com/res/ajax100.html

I got normal results on my regular profile. I got one out of four abnormal results on a clean profile; I don't have an explanation for that.

trolly
Moderator

User avatar
 
Posts: 39878
Joined: August 22nd, 2005, 7:25 am

Post Posted April 12th, 2015, 12:46 pm

10 times, 10 times ok ...

Network issue?? Wireshark log available maybe?
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.

schulzki
 
Posts: 4
Joined: April 11th, 2015, 1:48 am

Post Posted April 13th, 2015, 4:02 am

trolly wrote:10 times, 10 times ok ...

Network issue?? Wireshark log available maybe?


I can reproduce the issue running client and server on the same machine, so most prob. no network problem.

I found this issue when I detected loads of logfile entries for a productive client (It uses a framework with long polling ajax requests for comet push), so it is reproducible in different environments.

But strange that it is not fully reproducible on all FFV35+.....

trolly
Moderator

User avatar
 
Posts: 39878
Joined: August 22nd, 2005, 7:25 am

Post Posted April 13th, 2015, 5:05 am

BTW: I got this result:

GET XHR http://jeffersonscher.com/res/info.php [HTTP/1.1 200 OK 100359ms]
GET XHR http://jeffersonscher.com/res/info.php [HTTP/1.1 200 OK 6ms]
GET XHR http://jeffersonscher.com/res/info.php [HTTP/1.1 200 OK 100345ms]

The middle one had a response time of only 6 ms.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.

schulzki
 
Posts: 4
Joined: April 11th, 2015, 1:48 am

Post Posted April 13th, 2015, 7:15 am

just realized I never mentioned I use FF on windows (win7 64 bit), what is your OS?

trolly
Moderator

User avatar
 
Posts: 39878
Joined: August 22nd, 2005, 7:25 am

Post Posted April 13th, 2015, 7:32 am

Firefox Nightly 40 x64 on WXP and W7/64.

BTW We knew. Your user agent at least gave away your OS.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.

Return to Web Development / Standards Evangelism


Who is online

Users browsing this forum: Google Adsense [Bot] and 3 guests