I am using Hangfire with SQLServer (I've also tried InMemory which leaded to other problems).
I'm facing a weird issue, where I have a lot of jobs in queue and 4 jobs are beeing processed in parallel.
I've added a lot of logs to my own code to check where it is getting stucked.
I've assumed that if hangfire cant determine the state of the job its getting cancled anytime?
Anyway: I can see from the logs, that my job completed with success:
2023-01-30T07:22:51.267595296Z Extraction of '0x47ba3cdba6b6b5db:0x532b6cd370783333' completed. Next page CAESBkVnSUlaQQ==.
2023-01-30T07:22:51.277868061Z Downloading id 0x47ba3cdba6b6b5db:0x532b6cd370783333 (CAESBkVnSUlaQQ==).
2023-01-30T07:22:53.103529103Z Extraction of '0x47ba3cdba6b6b5db:0x532b6cd370783333' completed.
2023-01-30T07:22:53.116562079Z Completed extraction for '0x47ba3cdba6b6b5db:0x532b6cd370783333'. Found 102 elements.
Weird is, that it is still in processing state in the hangfire dashboard. Which leads to a job beeing processed forever.
I am also using Hangfire Console to log some more things to the dashboard. This is also not getting updated. Logs in my console are normally the same as on the dashboard output.
Background job is enqued like the following:
BackgroundJob.Enqueue<FileExtractor>(s => s.StartExtraction(null!, entity.Id, CancellationToken.None));
Function definition:
[AutomaticRetry(Attempts = 0)] public async Task StartExtraction(PerformContext context, string? id, CancellationToken ct = default)
I am using services which are registered transient. If that could lead to any help.
So from my log perspective I am pretty sure, that my function/background job is completing successfully but hangfire does not catch it anyhow.
Also when reenqueing the job which was stuck, hangfire wont take another one. He worked with 4 workers, I reenqueued the job which was stuck and now he is only working with 3 workers.
Hi,
I am using Hangfire with SQLServer (I've also tried InMemory which leaded to other problems). I'm facing a weird issue, where I have a lot of jobs in queue and 4 jobs are beeing processed in parallel.
I've added a lot of logs to my own code to check where it is getting stucked. I've assumed that if hangfire cant determine the state of the job its getting cancled anytime?
Anyway: I can see from the logs, that my job completed with success:
Weird is, that it is still in processing state in the hangfire dashboard. Which leads to a job beeing processed forever.
I am also using Hangfire Console to log some more things to the dashboard. This is also not getting updated. Logs in my console are normally the same as on the dashboard output.
Background job is enqued like the following:
BackgroundJob.Enqueue<FileExtractor>(s => s.StartExtraction(null!, entity.Id, CancellationToken.None));
Function definition:
[AutomaticRetry(Attempts = 0)] public async Task StartExtraction(PerformContext context, string? id, CancellationToken ct = default)
I am using services which are registered transient. If that could lead to any help.
So from my log perspective I am pretty sure, that my function/background job is completing successfully but hangfire does not catch it anyhow.