Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enqueued job is not being processed with MSMQ or RabbitMQ #294

Closed
odinserj opened this issue Jan 28, 2015 · 1 comment
Closed

Enqueued job is not being processed with MSMQ or RabbitMQ #294

odinserj opened this issue Jan 28, 2015 · 1 comment

Comments

@odinserj
Copy link
Member

From forum topic, please see http://discuss.hangfire.io/t/jobs-being-created-in-database-stuck-as-enqueued/583 for the details.

While performing a simple Enqueue such as:
BackgroundJob.Enqueue(() => Console.WriteLine("Test!"));
Hangfire will only attempt to process the job around 60% of the time. Further research shows that the job is being successfully inserted into the HangFire.Job table, but it is never processed.

@odinserj
Copy link
Member Author

The problem was related to a very quick worker that picked up a background job that was not fully initialized for the enqueued state. I've fixed it by waiting for a full initialization (with timeout) before trying to change the state to Processing. If timeout expires (or when process is killed), the job simply moves back to the queue.

@odinserj odinserj changed the title Enqueued job is not being processed Enqueued job is not being processed with MSMQ or RabbitMQ Jan 28, 2015
@odinserj odinserj mentioned this issue Jan 28, 2015
odinserj added a commit that referenced this issue Jul 11, 2016
READ_COMMITTED_SNAPSHOT option may affect read operations and lead to
issues like #294 or #452. This table hint cause db engine to always
acquire shared locks, and queries will wait for pending transactions
instead of returning stale results.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant