mercredi 6 mai 2015

How's 504 response header handled in ajax request in jquery?

I have an ajax call from client, that looks like that:

$.ajax({
            'url': '/converter/ajax-make-corrections/',
            'data': {

                corrections: JSON.stringify(globalCorrrectionsObject)
            },
            type: 'POST',
            success: function(data) {

            }
        })

This action send pretty big file to server to do some server job. The trouble is that there is timelimit on server - 30 minutes. After that server closes a connection with 504 errror (here is what I see in nginx access log file):

[06/May/2015:09:13:33 +0300] "POST /converter/ajax-make-corrections/ HTTP/1.1" 504

and at the same tim in nginx error.log file

*1799741 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 

There is no errors in apache log.

And here is what happened: action from browser was restarted 9 times exactly 30 minutes after each other. Since action in browser can not be start manually second time with same data, my best guess is that $.ajax action was restarting itself after getting 504 response. Is it possible? How $.ajax handles 504 response? Will it restart itself sending same data again?

Aucun commentaire:

Enregistrer un commentaire