HangfireIO / HangfireIO/Hangfire
SqlServer: A lot of processing job - timeout
- Dominant language
- C#
- Stars
- 10.1k
- Forks
- 1.8k
- Avg merge
- 1h 19m
- Merged PRs (30d)
- 1
Description
I got for one day 4kk processing job. When trying to check it via dashboard always got
The wait operation timed out
`[SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +54995377
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +764
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4243
System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +90
System.Data.SqlClient.SqlDataReader.get_MetaData() +103
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) +621
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) +3386
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) +710
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +83
System.Data.SqlClient.SqlCommand.ExecuteScalar() +2218
Dapper.SqlMapper.ExecuteScalarImpl(IDbConnection cnn, CommandDefinition& command) +301
Dapper.SqlMapper.ExecuteScalar(IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Nullable`1 commandTimeout, Nullable`1 commandType) +123
Hangfire.SqlServer.SqlServerMonitoringApi.GetNumberOfJobsByStateName(DbConnection connection, String stateName) +259
Hangfire.SqlServer.SqlServerStorage.UseConnection(DbConnection dedicatedConnection, Func`2 func) +73
Hangfire.SqlServer.SqlServerMonitoringApi.SucceededListCount() +74
Hangfire.Dashboard.Pages.SucceededJobs.Execute() +361
Hangfire.Dashboard.RazorPage.TransformText(String body) +31
Hangfire.Dashboard.RazorPageDispatcher.Dispatch(DashboardContext context) +89
Hangfire.Dashboard.<>c__DisplayClass1_1.b__1(IDictionary`2 env) +603
Microsoft.Owin.Mapping.d__0.MoveNext() +462`
Contributor guide
Research direction
Start with Hangfire.SqlServer.SqlServerMonitoringApi.GetNumberOfJobsByStateName and the SucceededJobs dashboard page shown in the stack trace. Reproduce the Succeeded jobs view against a database with a large processing-job volume, then investigate why the monitoring query exceeds its timeout. Done means the dashboard can load this view without the reported SqlException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100