Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The wait operation timed out. ASP

Tags:

I created an internal website for our company. It run smoothly for several months and then I made a major update due to user suggestion. When I run in live, it run normally. Then suddenly one of my user from japan sending me an "The Wait operation timed out." error. When I check access that certain link, It run normally for me and some other who I ask to check if they access that page. I already update the httpRuntime executionTimeout but still no luck. Is it the error come from database connection? If I increase the timeout in the database connection it will be fix the problem?

like image 205
Vic Avatar asked Aug 27 '16 01:08

Vic


People also ask

What is the meaning of wait operation timed out?

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ComponentModel.Win32Exception: The wait operation timed out.


3 Answers

Remember to increase the connection timeout AND the command timeout:

SqlConnection(@"Data Source=SQLSERVER;Initial Catalog=MYCATALOG;Integrated Security=True;Connection Timeout=1000");//huge timeout 

and then:

com.CommandTimeout = 950;//or whatever 
like image 175
Shannon Holsinger Avatar answered Sep 18 '22 03:09

Shannon Holsinger


If you found the exact error "The wait operation timed out" then it is likely you have a database call that took longer than expected. This could be due to any number of things:

  1. Transient network problem
  2. High SQL server load
  3. Problem with SAN, RAID, or storage device
  4. Deadlock or other form of multiprocess contention

You haven't shared enough information to troubleshoot. The way I would manage this would be to check for other occurrences of the problem and see if there is a pattern, e.g. if the problem occurs at a certain time of day.

Certainly increasing the timeout is not a bad idea (if it is currently set pretty low) and may resolve the problem in and of itself.

like image 20
John Wu Avatar answered Sep 19 '22 03:09

John Wu


I fixed this error by finding the exact procedure in event viewer where timeout was happening.

Connected to the same Database in SSMS and ran:

exec sp_recompile 'Procedure name'

It showed the below message:

Object 'Procedure name' was successfully marked for recompilation.

like image 31
user728630 Avatar answered Sep 20 '22 03:09

user728630