-
Notifications
You must be signed in to change notification settings - Fork 143
Open
Description
I have faced some issues related to the newly added feature resilient startup: #415.
- Scenario a/: db is down, app starts, app is not responsive (not accepting HTTP requests) until following line is logged: "Starting Hangfire Server using job storage: 'PostgreSQL Server:" (I guess once max retries reached?)
- Scenario b/: If in addition I am using the dashboard
app.MapHangfireDashboard("/hangfire"), then this whole resiliency won't be effective, the app will crash as before, I guess after max retry attempts reached?
My setup, running within an apsnet core project:
services.AddHangfire((provider, config) =>
{
var autoRetryPolicy = new AutomaticRetryAttribute {
...
OnAttemptsExceeded = AttemptsExceededAction.Fail
};
config.UseFilter(autoRetryPolicy);
config.UsePostgreSqlStorage(c => c.UseNpgsqlConnection(connectionString), new PostgreSqlStorageOptions()
{
PrepareSchemaIfNecessary = true,
AllowDegradedModeWithoutStorage = true,
StartupConnectionMaxRetries = 3,
StartupConnectionBaseDelay = TimeSpan.FromSeconds(2),
StartupConnectionMaxDelay = TimeSpan.FromSeconds(5),
//...QueuePollInterval, InvisibilityTimeout, JobExpirationCheckInterval, CountersAggregateInterval
});
});
services.AddHangfireServer((provider, options) => { //SchedulePollingInterval, Queues, WorkerCount, ServerCheckInterval
});
....
app.MapHangfireDashboard("/hangfire");
//... register recuring jobs
Is the behavior described here expected by the initial implementation of this feature? or there is something wrong in my setup? or does the resilient implementation needs a fix/improvement? Thanks!
Ps: Don't you think it is worth considering adding some logging? Regarding resiliency logic kicked-in, failed after max attempts?
Metadata
Metadata
Assignees
Labels
No labels