ISendEmailJob.ProcessPendingEmailsAsync

// Id: #31949
using TEQ.WorkerRole.Jobs;

var sendEmailJob = Activate<ISendEmailJob>();
await sendEmailJob.ProcessPendingEmailsAsync();

Parameters

CurrentCulture
""
RecurringJobId
"process-pending-emails"
Time
1764084722

State

11/25/2025 15:39:23 (+7m 20.066s) Failed

Failed to change state to a 'Processing' one due to an exception after 10 retry attempts

System.InvalidOperationException (lw0mdlwk0001l5:1875)

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.

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 Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry, SqlConnectionOverrides overrides)
   at Microsoft.Data.SqlClient.SqlConnection.Open(SqlConnectionOverrides overrides)
   at Hangfire.SqlServer.SqlServerStorage.CreateAndOpenConnection() in C:\projects\hangfire-525\src\Hangfire.SqlServer\SqlServerStorage.cs:line 406
   at Hangfire.SqlServer.SqlServerConnection.AcquireLock(String resource, TimeSpan timeout) in C:\projects\hangfire-525\src\Hangfire.SqlServer\SqlServerConnection.cs:line 800
   at Hangfire.SqlServer.SqlServerConnection.AcquireDistributedLock(String resource, TimeSpan timeout) in C:\projects\hangfire-525\src\Hangfire.SqlServer\SqlServerConnection.cs:line 67
   at Hangfire.Storage.StorageConnectionExtensions.AcquireDistributedJobLock(IStorageConnection connection, String jobId, TimeSpan timeout) in C:\projects\hangfire-525\src\Hangfire.Core\Storage\StorageConnectionExtensions.cs:line 33
   at Hangfire.States.BackgroundJobStateChanger.ChangeState(StateChangeContext context) in C:\projects\hangfire-525\src\Hangfire.Core\States\BackgroundJobStateChanger.cs:line 69
   at Hangfire.Server.Worker.TryChangeState(BackgroundProcessContext context, IStorageConnection connection, String jobId, IState state, IReadOnlyDictionary`2 customData, String[] expectedStates, IFetchedJob completeJob, BackgroundJob& backgroundJob, CancellationToken initializeToken, CancellationToken abortToken) in C:\projects\hangfire-525\src\Hangfire.Core\Server\Worker.cs:line 235

+617ms Enqueued

Triggered by recurring job scheduler

11/25/2025 15:32:03 Created