Search code examples
javascriptajaxapachegoogle-chromeintersystems-cache

Simultaneous hang asynchronous and synchronous requests on Google Chrome


My system environment is:

  • Intel Core i3-2310M 2.10 GHz
  • Windows 7 Home Basic
  • Google Chrome or Opera
  • Apache on 127.0.0.1 with CSP module (for InterSystems Caché® database system)

The page at http://127.0.0.1/csp/projectname/page.csp starts an asynchronous request, and immediately thereafter it starts a synchronous request. As a result, both queries are performed for 4 minutes (state is "pending"), and the browser hangs. After 4 minutes synchronous request returns a response - a short html-page, with the following contents

<HTML><HEAD>
<TITLE>Not Found</TITLE>
</HEAD><BODY>
<H1>Not Found</H1>

The requested URL /csp/projectname/dynamicpage.csp was not found on this server.

An asynchronous request receives the status of failed and causes an error net :: ERR_INCOMPLETE_CHUNKED_ENCODING. Colleagues the same page opens with no problems, his browser is Chrome on Windows 8.1 and processor is Intel Core i5. We found that he had performed first synchronous request, and then asynchronous. Try different methods of diagnosis, it seems to me that the case in the OS and Chrome, but maybe I'm wrong. In Firefox, the page opens with no problems. The answer to the asynchronous request returns a 1 megabyte of data. The answer to the synchronous request returns about 400 bytes. Still there is the assumption that the problem occurred after installing the browser Opera, but I have great doubts about this.


Solution

  • The default behaviour on the server is to enforce sequential processing of requests for a single user session by locking the session. As such, if the first request that takes a long time to process doesn't manually unlock the session, the second request will queue up behind the first one until it completes. You likely need to call %session.Unlock() in your long-running server code.