Jon Schneider Jon Schneider - 9 months ago 177
C# Question

Hangfire DisableConcurrentExecution: What happens when the timeout expires?

Per the Hangfire 0.8.2 announcement post, Hangfire has a

filter which, when applied to a method, prevents multiple instances of the method from executing concurrently.

filter takes a
int parameter. From the example in the linked article:

[DisableConcurrentExecution(timeoutInSeconds: 10 * 60)]
public void SomeMethod()
// Operations performed inside a distributed lock

My question is: What happens when, given a job which is waiting on obtaining the lock for a
-filtered method, the time that the job has been waiting exceeds the

Answer Source

I tested that recently. That job instance was recorded as failed in the dashboard and listed the exception which indicated that the timeout had expired while waiting for an exclusive lock.

I'd send you more details but I'm on my phone right now :)