0

Hello I've got this problem only on the amazon cloud. On my localhost everything is fine but on the servers when a request delays more than 60 sec it is repeated again with the same timestamp. I have a demo page which submits the ajax here it is:

<div id="fb-root"></div>
<div id="results">Hello
</div>

<script>
jQuery(document).ready(function() {
jQuery.ajax({
            url : "{{ path('_sleep') }}",
            type : "GET",
            cache : false,
            dataType : 'json',
            success : function(data, textStatus, jqXHR) {
                console.log(jqXHR);
            },
            error : function(jqXHR, textStatus, errorThrown)
            {
                console.log(jqXHR);
            }
        });
})
</script>

At the server side in my sleep action the code is:

public function sleepAction()
    {
        $logger = $this->get("logger");

        $logger->info("start sleep");
        usleep(61000000);
        $logger->info("end sleep");

        return new Response(json_encode(true));
    }

PHP access log looks like this:

    10.204.49.55 - - [22/Apr/2013:13:52:48 +0000] "GET /s2p/web/app_dev.php/sleep?_=1366638768072 HTTP/1.1" 200 4 "http://dev.lobama.com/s2p/web/app_dev.php/test" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4" "0, -" 
10.204.49.55 - - [22/Apr/2013:13:52:50 +0000] "GET /s2p/web/favicon.ico HTTP/1.1" 404 517 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4" "0, -" 
::1 - - [22/Apr/2013:13:53:49 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.16 (Amazon) (internal dummy connection)" "0, -" 
::1 - - [22/Apr/2013:13:53:50 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.16 (Amazon) (internal dummy connection)" "0, -" 
::1 - - [22/Apr/2013:13:53:51 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.16 (Amazon) (internal dummy connection)" "0, -" 
::1 - - [22/Apr/2013:13:53:52 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.16 (Amazon) (internal dummy connection)" "0, -" 
10.204.49.55 - - [22/Apr/2013:13:53:53 +0000] "GET /index.html HTTP/1.1" 200 3375 "-" "ELB-HealthChecker/1.0" "0, -" 
::1 - - [22/Apr/2013:13:53:53 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.16 (Amazon) (internal dummy connection)" "0, -" 
::1 - - [22/Apr/2013:13:53:54 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.16 (Amazon) (internal dummy connection)" "0, -" 
10.204.49.55 - - [22/Apr/2013:13:54:23 +0000] "GET /index.html HTTP/1.1" 200 3375 "-" "ELB-HealthChecker/1.0" "0, -" 
::1 - - [22/Apr/2013:13:54:47 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.16 (Amazon) (internal dummy connection)" "0, -" 
::1 - - [22/Apr/2013:13:54:48 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.16 (Amazon) (internal dummy connection)" "0, -" 
::1 - - [22/Apr/2013:13:54:49 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.16 (Amazon) (internal dummy connection)" "0, -" 
10.204.49.55 - - [22/Apr/2013:13:53:47 +0000] "GET /s2p/web/app_dev.php/sleep?_=1366638768072 HTTP/1.1" 200 4 "http://dev.lobama.com/s2p/web/app_dev.php/test" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4" "0, -" 
10.204.49.55 - - [22/Apr/2013:13:54:53 +0000] "GET /index.html HTTP/1.1" 200 3375 "-" "ELB-HealthChecker/1.0" "0, -" 
10.204.49.55 - - [22/Apr/2013:13:55:23 +0000] "GET /index.html HTTP/1.1" 200 3375 "-" "ELB-HealthChecker/1.0" "0, -" 
::1 - - [22/Apr/2013:13:55:47 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.16 (Amazon) (internal dummy connection)" "0, -" 
10.204.49.55 - - [22/Apr/2013:13:54:47 +0000] "GET /s2p/web/app_dev.php/sleep?_=1366638768072 HTTP/1.1" 200 4 "http://dev.lobama.com/s2p/web/app_dev.php/test" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4" "0, -" 
10.204.49.55 - - [22/Apr/2013:13:55:53 +0000] "GET /index.html HTTP/1.1" 200 3375 "-" "ELB-HealthChecker/1.0" "0, -" 
10.204.49.55 - - [22/Apr/2013:13:56:23 +0000] "GET /index.html HTTP/1.1" 200 3375 "-" "ELB-HealthChecker/1.0" "0, -" 
::1 - - [22/Apr/2013:13:56:48 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.16 (Amazon) (internal dummy connection)" "0, -" 
10.204.49.55 - - [22/Apr/2013:13:55:47 +0000] "GET /s2p/web/app_dev.php/sleep?_=1366638768072 HTTP/1.1" 200 4 "http://dev.lobama.com/s2p/web/app_dev.php/test" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4" "0, -" 

As you can see request is repeated 3 times not including initial one. After that it stops even though I was thinking it is going to repeat again. And my own log shows:

[2013-04-22 15:52:48] logger.INFO: start sleep [] []
[2013-04-22 15:53:49] logger.INFO: end sleep [] []
[2013-04-22 15:53:49] logger.INFO: start sleep [] []
[2013-04-22 15:54:50] logger.INFO: end sleep [] []
[2013-04-22 15:54:50] logger.INFO: start sleep [] []
[2013-04-22 15:55:51] logger.INFO: end sleep [] []
[2013-04-22 15:55:51] logger.INFO: start sleep [] []
[2013-04-22 15:56:52] logger.INFO: end sleep [] []

Feel free to give suggestions.Thanks.

4

0 回答 0