次のようなメッセージが表示されます。 - 2台のWebサーバーがロードバランス設定で実行されています。 - これらの各OwinStartup.csに次のコードでジョブを定期的エンキューすることができます'サーバーハートビート' - ロードバランスの実行中にエラーが発生しました
GlobalConfiguration.Configuration.UseSqlServerStorage("ConnectionString")
.UseFilter(new LogFailureAttribute());
app.UseHangfireServer();
RecurringJob.AddOrUpdate("Job",() =>FunctionTrigger(), Cron.Daily(5, 0));
FunctionTriggerは、データベースにレコードを挿入するステートレストランザクションセッションを使用したシンプルな機能です。
したがって、1つのサーバーを使用しているジョブが正常に実行されていますが、負荷分散でエラーが発生し、レコードがDBに挿入されません。
これは、ログエラーです:ジョブは、各サーバー上の牽引回を実行するため
Hangfire.Server.ServerHeartbeat - Error occurred during execution of 'Server Heartbeat' component. Execution will be retried (attempt 2 of 2147483647) in 00:00:03 seconds.
System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource1 retry)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at Hangfire.SqlServer.SqlServerStorage.GetConnection()
at Hangfire.Server.ServerHeartbeat.Execute(CancellationToken cancellationToken)
at Hangfire.Server.AutomaticRetryServerComponentWrapper.ExecuteWithAutomaticRetry(CancellationToken cancellationToken)
私はHangfire 1.4.5
使用しています**これはありますか?!どのように私はそれを避けることができます。 ?! ** ありがとうございます。
上記に対するコメントはありますか? –