Open sommmen opened 9 months ago
same issue here... it seems that the exception gets thrown when the hangfire job itself finishes before the latest progressBar value gets written ...
EDIT: This is my exception:
System.InvalidOperationException: ExecuteNonQuery requires an open and available Connection. The connection's current state is open.
at Microsoft.Data.SqlClient.SqlCommand.ValidateCommand(Boolean isAsync, String method)
at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)
at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Hangfire.SqlServer.SqlCommandBatch.ExecuteNonQuery()
at Hangfire.SqlServer.SqlServerWriteOnlyTransaction.<Commit>b__17_0(DbConnection connection, DbTransaction transaction)
at Hangfire.SqlServer.SqlServerStorage.<>c__DisplayClass42_0`1.<UseTransaction>b__0(DbConnection connection)
at Hangfire.SqlServer.SqlServerStorage.UseConnection[T](DbConnection dedicatedConnection, Func`2 func)
at Hangfire.SqlServer.SqlServerWriteOnlyTransaction.Commit()
at Hangfire.Console.Storage.ConsoleStorage.AddLine(ConsoleId consoleId, ConsoleLine line)
at Hangfire.Console.Server.ConsoleContext.AddLine(ConsoleLine line)
at Hangfire.Console.Progress.DefaultProgressBar.SetValue(Double value)
I have multiple jobs running and occasionally i run into the following issue:
Happens on some progressbars:
Seems to be an issue where somehow the connection gets closed too early? Any help would be awesome.
Packages:
I am also now running the identitystream fork to see if it helps, but it does not for this issue.
<PackageReference Include="IdentityStream.Hangfire.Console" Version="2.0.0" />