2

I'm experiencing a problem that hard to describe. I'll start with steps to reproduce, and then continue with details. So the steps in general:

  1. run a long-running operation on the website (change report statuses, POST)
  2. try to open another page in the same browser, but another tab (list reports, GET)
  3. try to open the same page as on step 2, but using another browser/incognito mode

The result of this is: let's say, the first operation takes 80 seconds to complete, the second operation takes exactly the same time as the first one, but, what is most interesting, the third one takes less than 1 sec to complete. All the 3 request use the same credentials.

The application is build by using ASP.NET MVC 3; IIS 8.5, .NET v4.5 application pool. No DB locks.

The long-running operation is call to the internal asmx web service that hosted in the same application (many calls, one-by-one, avg execution time is 1.5 sec). All the steps are using the different methods of the same controller.

Here is IIS log for the steps (step 1 - line 67, step 2 - line 68, step 3 - line 14).

Why there is such a timeout by running the step 2, despite the step 3 executes without any delay?


EDIT:

thanks to @arknotts, seems that this was a session lock.

Just want to share some link for those who will face the same problem:

Community
  • 1
  • 1
Oleks
  • 31,955
  • 11
  • 77
  • 132

1 Answers1

3

ASP.NET by default only allows one request to run at a time per session. Any additional requests during this time will queue up. While request #1 is running, request #2 is blocked until the first is finished. Request #3 is processed just fine because it is assigned a different session than the others (by using incognito mode/another browser). You can do two things:

  • Disable session state
  • If disabling session state isn't an option, you need to spawn a new thread for request #1 and return back to the browser immediately.
arknotts
  • 454
  • 3
  • 13