First of all I would like to point out that this is, in my eyes, not a duplicate question, because the timeout as described in the title happens 8/10 times. So not always.
We have a .NET application with Dapper, but all of a sudden the application stops the request after 30 seconds. We have had this issue before and fixed it by updating all limit
options in IIS and adding executionTimeout="00:30:00"
to the web.conf
file of IIS. (In the aspNet section).
The above fixed the issue for one of our applications, including this one. But all of a sudden this problem seems to be back.
The strange thing is that it doesn't always happen. Sometimes the application continues with the request for 40, 50 or more seconds. But 8/10 times it stops after exactly 30 seconds.
We also have a executionTimeout
set in the code where we call the query. This is set on 1800 seconds.
In our eyes this must be a IIS issue or perhaps even a database issue (MSSQL)? But we are unsure what to do next, because it doesn't always happen. If it was a IIS problem, wouldn't it always happen even if we test it a thousand times?
If someone could help us with this problem we would really appreciate it.
Thanks in advance!
EDIT code snippets:
C#:
var result = await _connection.QueryAsync<Sample>(sql, commandTimeout: 1800);
web.config:
<aspNetCore ... executionTimeout="00:30:00" ... />