-
March 27th, 2009, 05:36 PM
#1
Hi Mone,
We had a Javascript bug that used to keep the browser frozen for 10 seconds or even longer when it does a long blocking calculation. I guess when the Javascript thread was busy doing this long processing, there is no chance for the LS Javascript client to talk to LS server.
Could this cause the degradation from STREAMING to POLLING or the disconnect? Can you please explain how the JS client/server decides to disconnect?
Fortunately I found the bug and fixed it. Now our app won't go into a 10 seconds loop any more.
Thanks,
Richard
-
March 30th, 2009, 09:12 AM
#2
yes, as javascript is mono-thread, blocking the browser in a long execution blocks also the communication with the server and so can cause the coonection to be reinitialized in POLLING.
The client library passes from STREAMING to POLLING in two cases:- the STREAMING connection can't be initialized (ie after opening the connection no data is received before a certain timeout).
see also setBufferedStreamingHandled - there is a heavy load on the machine and the client tries to degradate to POLLING in the hope to diminish such load
see setSlowingEnabled
HTH
-
March 30th, 2009, 02:34 PM
#3
Hi Mone,
That explains the degradation from STREAMING to POLLING. Thanks.
But I'd still like to understand how the connection disconnect/reconnect happens when javascript enters a long running execution block. And how changing <session_timeout-millis> could help mitigate this issue. Can you please advise?
Thanks,
Richard
-
March 30th, 2009, 02:51 PM
#4
Hi Richard,
If the client code cannot consume the heartbeats sent over the stream connections, it will go into STALLED state, and after a while while disconnect and automatically go into CONNECTING state (trying to reconnect).
You can control these timeouts through the setTimeoutForStalled and setTimeoutForReconnect methods.
-
March 30th, 2009, 05:30 PM
#5
Hi Alessandro,
Thanks for the info. That's very helpful.
I'm curious how <session_timeout_millis> comes into play with disconnect/reconnect. Does the default value of 5 seconds mean that the connection disconnects after 5 seconds of no heartbeat? Can you please explain?
Richard
-
March 31st, 2009, 01:16 PM
#6
The <session_timeout_millis> is unrelated to disconnections and reconnections. It's used when the configured content-length is exhausted, in order to wait for a rebind connection. The only benefit the <session_timeout_millis> provides after a disconnection is to keep the items subscribed toward the Data Adapter for a while, optimizing the next reconnection phase.
Similar Threads
-
By chanro4 in forum Client SDKs
Replies: 1
Last Post: January 19th, 2011, 10:23 AM
-
By EWANG in forum Client SDKs
Replies: 12
Last Post: August 19th, 2010, 08:52 AM
-
By GoatHunter in forum Client SDKs
Replies: 3
Last Post: August 31st, 2009, 08:57 AM
-
By rsouissi in forum Client SDKs
Replies: 3
Last Post: February 1st, 2008, 08:49 AM
-
By ddhanis in forum General
Replies: 1
Last Post: December 14th, 2007, 04:39 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 05:45 PM.
Bookmarks