Search code examples
c#asp.net-web-apibackground-processjobshangfire

Hangfire background job mysteriously stops running


I have one odd issue with Hangfire 1.4.3.0 (WebAPI, SQL server storage) - after exactly 30 mins since job started, hangfire restarts it and assigns a new worker. Default hangfire logging at trace level doesn't show anything useful. In my web app logs I can only see that job started and State table in hangfire database shows that new worker assigned:

Id  JobId   Name    Reason  CreatedAt   Data
27  8   Processing  NULL    2017-05-17 10:34:51.640 {"StartedAt":"2017-05-17T10:34:51.6389278Z","ServerId":"mypc:3332","WorkerNumber":"22"}
28  8   Processing  NULL    2017-05-17 11:04:51.683 {"StartedAt":"2017-05-17T11:04:51.6819303Z","ServerId":"mypc:3332","WorkerNumber":"14"}

But what happened to previous worker? How I can find out why it stopped?


Solution

  • Apparently this is known bug: https://github.com/HangfireIO/Hangfire/issues/514

    Hangfire is currently on version 1.6.12 - have you tried updating to the latest version and checking if you still get the issue?