none
IE can become unresponsive during Ajax requests

    Question

  • We have detected that IE can become unresponsive during Ajax requests.


    Problem:
    If the page that fires an Ajax request navigates away or closes the window before the service has send back a response, IE hangs and become unresponsive.
    The problem does not occur imminently, so the above scenario has to be performed 7 times before IE8 becomes unresponsive (due to the default of 6 connections in IE8).

    To reproduce:
    Create 2 html files (page A & B), where page A contains a link for opening page “B” in a new window. In page B perform an Ajax request.
    Create a service that returns a xml response but simulates latency by sleeping for some time, for instance 10 seconds.

    Click the link on page “A” to open the window that fires an Ajax request and close the popup window again before the service responds… Do this 6 times and afterwards, IE becomes unresponsive….and needs to be closed..

    Pseudocode :
    a.htm
        <body>
            <a href="b.htm " target="_NEW">Open window with Ajax request!</a>
        </body>
     
    b.htm
        <body onload=”performAjax()”>
        </body>
    
    

    Kind regards

    Torben Riis

    Friday, February 26, 2010 9:36 AM

All replies

  • Hi,

    The simple answer is "Don't do that".

    I use third-party web controls from Telerik (excellent!). The AJAX form control overlays a div element over the calling page so that users cannot navigate away from the current page.

    The whole purpose of AJAX is to enable users to change the content of the current page without the need to raise a new request for the current page or to navigate away from it.

    Regards.
    Rob^_^
    Saturday, February 27, 2010 8:01 PM
  • Hi,

    This is simply not an option, and it should be mentioned that, users could click the navigation buttons, choose a bookmark, or just close a popup window that executing an Ajax request and still get IE unresponsive….. So overlays  is not a circumvention.

    If I watch the Ajax connections with Fiddler, I can see that all requests returns successfully (with http status code 200) even though the popup window is closed before the response is retrieved. But still, IE hangs or gets unresponsive when all the connections has been used

    Kind regards
    Torben Riis
    Tuesday, March 02, 2010 10:36 AM
  • Don't suppose you have a full repro or link you could share?
    Tuesday, March 02, 2010 7:58 PM
    Moderator
  • Hi,

    Actually I have just created one for testing purpose…
    http://188.228.21.172:8080/ie/test

    Just found a new thing to the case. When IE first gets unresponsive (after several open/close of windows). If you leave the window open, and wait for a long time, for instance 30 minutes, you will be able to use the browser instance again…

    Kind regards
    Torben Riis
    Wednesday, March 03, 2010 12:55 PM
  • Yea the issue does repro for me, but it exceeds my knowledge of the network stack in IE. I'll file a bug and someone will look into it (no promises on when though).
    Friday, March 05, 2010 6:01 AM
    Moderator
  • Hi,

    Thanks a lot.. I appreciate that you took the time to look at it.
    Will it somehow be possible to get a bug tracking id thats possible for the community to follow?

    /Torben Riis
    Multi-Support R&D
    Friday, March 05, 2010 11:44 AM
  • Unfortunately not :(. During the public betas of IE8 there was a public site for users to file and follow at https://connect.microsoft.com/IE/Feedback I can't comment if there will be a similar site for the next release, but if there is I'm sure it will be posted here.
    Saturday, March 06, 2010 3:53 PM
    Moderator
  • When I was dealing with this problem I found that it works somehow in this way:

    Some of new opened windows creates a new process of IE (not all of them - it happens for about first 4-6 windows, then

    the new windows are randomly assigned to the existing processes).

    Limit of MAX_CONNECTIONS in registry is respective for each process, so it could happen that new window will hang waiting

    for not closed requests completion, whereas another new window will work properly. After some time of being unused the processes

    opened for new window (which had been closed) are automatically closed (probably the limit is also cleared), so there happens the case described earlier by Torben Riis:

    If you leave the window open, and wait for a long time, for instance 30 minutes, you will be able to use the browser instance again…

     

    I have dealt with the problem by closing all the existing and not received requests in window.onunload function in JS.

    Wednesday, April 21, 2010 9:27 AM
  • We're having this exact same problem in IE7, except that we don't have to wait until after we've opened 6 windows - it happens on the second one!  If it happened after 6 new windows, it wouldn't be so much of an issue, but if our users hit the wrong link to open a new window, and immediately close it and select the correct link - they're hung!  In a Production environment, this is unacceptable.  We've had to modify our code to reduce the number of AJAX calls, but it's still happening.  Since this was reported a few months ago, dare I hope that there is a fix for this in IE7?   I'll even settle for code workarounds!

     

    Thanks!

    --Mitch

    Monday, August 16, 2010 3:58 PM
  • Hi,

    The test case provided by Torben (http://188.228.21.172:8080/ie/test) is no longer available.

    Do you have a link to your site we can have a look at.

    alternatively (this thread is quite dated)

    http://connect.microsoft.com/ie is open again for ie issue reports. You can raise an issue report there.

    We can't read minds, but we can read markup, css and script. Without a link we can only wildly guess. Please also include the full error messages that you are receiving also.

    I suppose you have already validated your markup, tested in noAddons mode and ensured that you have enabled IE debugging to catch scripting errors in your test environment.

    The tool of choice for inspecting networking issues is the fiddler tool.. http://www.fiddlertool.com.

    My wild guess would be that you are probably using document.write or innerHTML= with a xhtml DTD.... Install the Tidy HTML validator in FX and run it to detect incorrect 'C' strings.

    Regards.


    Rob^_^
    Monday, August 16, 2010 8:14 PM
  • Glad to here it and thanks for the feedback. I am a volunteer troll so the verbal gratuity is most welcome.
    Rob^_^
    Saturday, September 18, 2010 5:37 AM
  • Unless the gratuity has nothing to do with your effort but has everything to do with spamming...

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Monday, January 31, 2011 4:53 AM
  • HI Torben,

    I'm also facing the same issue when I click multiple times in the internet explorer leads to browser hang.

    Please help us in handling this issue.


    Thank You.

    Thursday, May 08, 2014 5:35 AM
  • @Naresh-- Please don't resuscitate a several year old thread. The "Window closure can lead to AJAX connection leak" issue was addressed a very long time ago.

    Instead, please open a new thread and include in your question a URL that reproduces the problem, as well as details about what version of IE and Windows are in use, and anything special about your environment (e.g. Proxy server, VPN, etc).

     
    Thursday, May 08, 2014 4:21 PM