-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unknown error 258 : The timeout period elapsed prior to completion #1435
Comments
Without code, we won't be able to help here. All I can tell you based on that info is: it's timing out. This isn't likely due to Dapper, but more likely due to a table lock on the SQL side preventing the insert for an extended period of time. To determine this you'll need to look on the server when it's happening, e.g. via Note: you don't need the error to see it most of the time. Generally speaking, a situation like this is going to occur far more often than you're getting a timeout...it's just not stalling long enough to timeout in the other cases. I'd advise hopping on the server and observing for a bit to see who's blocking who. |
I met a similar issue, the log is like below, only a little part of queries has this issue. After google, found
|
Well, |
Got it, thanks, maybe I need to ask in |
Given this is a SQL issue not specific to Dapper, closing out here and watching dotnet/SqlClient#647 :) |
have the some problem here, |
Have the same problem:
|
Have same problem here:
|
There are two different errors / stack traces here. The However @cuongvu0203 @luarvic issueand my issue is a different stack trace nothing to do with In my case I am using EF Core with Azure SQL. The thing "timing out" is a select query. However I can't see anything wrong with the query and when it works it runs quite quickly. My suspicion is this:
/// <summary>
/// <para>
/// Configures the context to use the default retrying <see cref="IExecutionStrategy" />.
/// </para>
/// <para>
/// This strategy is specifically tailored to SQL Server (including SQL Azure). It is pre-configured with
/// error numbers for transient errors that can be retried.
/// </para>
/// <para>
/// Default values of 6 for the maximum retry count and 30 seconds for the maximum default delay are used.
/// </para>
/// </summary>
/// <remarks>
/// See <see href="https://aka.ms/efcore-docs-connection-resiliency">Connection resiliency and database retries</see>
/// for more information.
/// </remarks>
public virtual SqlServerDbContextOptionsBuilder EnableRetryOnFailure()
=> ExecutionStrategy(c => new SqlServerRetryingExecutionStrategy(c)); I am going to try wrapping my dapper query in its own polly retry to see if this "solves" the issue, and then see if I can tie up the logs with the azure sql "pausing" on inactivity. |
@dazinator Have you got this working? I got a similar scenario myself... Trying to understand if it actually is as you explained. Thanks! |
Hi Team,
We are facing timeout issue when try to insert data in a table. The issue is intermittent. The table has only 4 columns and primary key as well.
Details of the code and Infra: -
Error details: -
ExceptionMessage: 'Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.';
Inner exception message: 'Unknown error 258'
Message: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Thanks in advance.
The text was updated successfully, but these errors were encountered: