Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    May 2010
    Location
    Pisa
    Posts
    10

    Silverlight client hanged when closing the browser window

    Hi,

    When I try to quit my silverlight client by closing the browser window, the browser process remains hang. It looks like that some internal trheads spawned by the Lightstreamer API are preventing the process from closing.

    Please find attached the results of the analysis I carried out so far.
    If you could help me sorting this issue out it would be great.

    Thank you,
    Emilio Bova
    Attached Files Attached Files

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,015
    The WaitOne calls in which the reported threads are stuck are supposed to have a short life. The involved monitor is used to wait for the outcome of a connection attempt and it is released after the connection attempt has completed with either success or failure.

    When I try keeping the response blocked on the Server and closing the browser, it still closes immediately, though the process remains alive for a few seconds more.
    Is that the issue you are reporting or, in your case, does the browser stay alive forever?
    Otherwise, may you please help us replicating the issue?

  3. #3
    Member
    Join Date
    May 2010
    Location
    Pisa
    Posts
    10
    Hi,

    Unfortunately the browser seems to stay alive forever. I've tried both with Firefox 3.6.3 and IE 8 (v 8.0.7600.16385) running my client on Silverlight 4, with the same result: the browser window closes, but the process remains there and I'm forced to kill it.

    What would you require from my side to help you going on with the investigation?

    Thanks,
    Emilio

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,015
    Please reproduce the following test:
    1. launch a new instance of IE8 (v 8.0.7600.16385)
    2. open the online Silverlight demo http://www.lightstreamer.com/demo/Si..._StockListDemo through the address bar
    3. activate the demo fully, through the subscribe button
    4. close the browser


    I see that two iexplore processes are created after step 1, then no more.
    After step 4, the two processes disappear.
    Do you notice the same?
    If not, is there any other sequence of actions that triggers the issue (preferably based on the online demo)?
    (I'm using windows 7 with Silverlight 4)

  5. #5
    Member
    Join Date
    May 2010
    Location
    Pisa
    Posts
    10
    I already tried that here (same configuration Win7+ SL4) both with the online version and a version hosted by my local Lightstreamer server and in those cases the browser did shut gracefully down after a very short while, as you described.

    My client looks actually like the SL demo, but there is a substantial difference: I've put together a mechanism that automatically reconnects to the Lightstreamer server in case the connection is lost (basically by attempting a reconnection in a while if the previous connection attempt failed or an existing connection is dropped).

    Please look at the file I attached to my first post. I believe that the only object that can keep a connection to a LS server alive is the LSClient class: is that correct?. In my case, I have two instances of LSClient that have strong reference. The one I suspect to be the culprit of the issue is actually alive only on the stack of a "SessionActivitymanager" thread (thread 43 in the report), while the other one is kept alive on another "SessionActivitymanager" thread (thread 45). No other threads - notably, application threads or background threads explicitly spawned by my application - are referencing any LSClient class.

    What I imagine is that, for some reason, the fact that two LSClient are actually instanced prevents somehow those threads from shutting down.

    Can you confirm this?

    Coming to your question
    > If not, is there any other sequence of actions that triggers the issue (preferably based on the online demo)?
    I have not been able to identify yet a specific sequence of actions. It would seem that establishing a connection to a Lightstreamer server is enough to trigger that behaviour, but I do not have yet a specific sequence.

    Please let me know your findings or if you would like me to perform more specific tests.

    Thank you,
    Emilio

    PS
    Should this analysis fail to yield results, might I propose to enhance the LSClient class with a "Dispose" or "Shutdown" method which would abort the service threads and release the resources? Or to provide an option to have SL API spawn "background" threads, that do not keep a process alive when exiting?

  6. #6
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,015
    Ok; if we had the opportunity to replicate the issue it would be easier.
    Anyway, you are right and there are a couple of fixes that we can do to improve the management of the internal threads.

    There is a caveat, though:
    The thread involved in your thread dump, i.e. the thread which dequeues data from streaming connections (or waits for data on long polling connections) cannot be declared as a background thread,
    because, during the normal session activity, it is possible that this thread is the only one active.

    For now, we need that you try to replicate the issue with a test version of the Silverlight library, which we will be sending you privately.

  7. #7
    Member
    Join Date
    May 2010
    Location
    Pisa
    Posts
    10
    After some analysis I found that our application sets as default HTTP request creator the ClientHttp one, instead of the default BrowserHttp. Doing this seems to somehow have side effects on the normal operations of Lightstreamer's API.

    For the time being, I have worked that around by forcing the usage of BrowserHttp creator for requests created to the Lightstreamer URL, and now the browser process shuts cleanly down when its window is closed.

    Thank you,
    Emilio

    PS
    As a side note, I observed that I was not able to establish a streaming connection when using ClientHttp creator. I can now do that using BrowserHttp.

  8. #8
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,015
    Ok; admittedly, the ClientHttp configuration case is not handled by the library properly; it doesn't support streaming and, upon a streaming answer from the Server, the Silverlight runtime keeps a reading thread open, which prevents the whole process from closing until the answer has finished.
    For the next release, our plans are to force the library to lean on the BrowserHttp case.

    In principle, the issue may be related not only with the ClientHttp, but also with other cases in which the streaming answer is buffered.
    This is because, even though the Stream-sense mechanism can overcome the problem by opening a polling session, it cannot force the closure of the streaming connection.
    We will work on improving this aspect.
    Anyway, our tests have always shown that, when the streaming connection is blocked by something in the middle (for instance, a proxy), the Silverlight runtime behaves differently and there is nothing preventing the process from closing.

 

 

Similar Threads

  1. FF9 redirect to a new blank window
    By cara713 in forum Client SDKs
    Replies: 1
    Last Post: January 13th, 2012, 09:54 AM
  2. Silverlight Client Connection problem in IE
    By kkrisjoy in forum Client SDKs
    Replies: 7
    Last Post: December 17th, 2010, 10:30 AM
  3. Disable Window Status
    By chuan_ckc in forum Client SDKs
    Replies: 7
    Last Post: December 17th, 2009, 11:15 AM
  4. No Updated on Silverlight Client
    By gjoseph in forum Client SDKs
    Replies: 1
    Last Post: November 13th, 2009, 12:14 PM
  5. IE8 shows a small window
    By markgoldin in forum Client SDKs
    Replies: 5
    Last Post: September 26th, 2008, 12:28 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 02:12 AM.