1

Does anyone meet the problem when all the timeouts and intervals are stopped without any reason?

It seems that it happens in WebKit browsers, including QtWebKit custom app. Especially when minimized, but not every time.

I've never seen the problem at my PC, but several customers report the symptoms that point on it, and in logs I see that their client stops pinging the server.

The project uses ExtJS, Google Maps and some other open-source libraries.

Pavel Koryagin
  • 1,479
  • 1
  • 13
  • 27
  • Are these your own timeouts and intervals, or those being used in an included library? I ask because another user had a problem with jQuery animate stacking animations when a tab loses focus, and then executing them all in quick succession when the page regains focus (http://stackoverflow.com/questions/6112671/settimeout-speeds-up-with-multiple-tabs ) – Matt Jun 01 '11 at 21:09
  • Yes, these are my own intervals. They stop rarely and unpredictable. Also, I've tried to overload clearInterval/clearTimeout funcs to prevent libraries from stopping my intervals. But it did not help too. – Pavel Koryagin Jun 01 '11 at 21:19

2 Answers2

1

Chrome/webkit suspend timeouts/intervals when the tab is moved to the background. That may be the issue here (you customers may have switched tabs whilst your intervals/timeouts where running). Check my SO-question for more information, or see the suspension in action

Community
  • 1
  • 1
KooiInc
  • 119,216
  • 31
  • 141
  • 177
  • Thanks. This is important. But slow down is not a problem: I have server-side timeouts of 15 seconds and ping interval of 5 seconds. In logs I've seen the following: a series of pings, then a 20 minutes silence, then a new request initiated by user. The question is where the interval requests in this 20 minutes period? – Pavel Koryagin Jun 01 '11 at 21:37
  • Ok, that's diffent. I don't think the answer is simple. It can still be a browser issue, or something at the server (something that triggers a timeout after 15 seconds despite the 5 sec ping etc.). I think you'll have to add some checks and balances to your scripting to follow what happens. – KooiInc Jun 01 '11 at 22:24
0

I know you said it's mostly when the browser is minimized, but is the page responsive at all if you are seeing this behavior on an active/visible page? If the page is unresponsive, slow to react to user interaction, etc, could be some other JavaScript function (other than your timeouts/intervals) is sucking up the thread. And since JS is single threaded (with some HTML5 exceptions), then it could prevent other JS from running.

Matt
  • 41,216
  • 30
  • 109
  • 147