# Jobs being created in database, stuck as Enqueued

**URL:** <https://discuss.hangfire.io/t/jobs-being-created-in-database-stuck-as-enqueued/583>\
**Category:** bug?\
**Tags:** msmq, queues\
**Created:** [January 22, 2015, 7:52pm UTC](https://discuss.hangfire.io/t/jobs-being-created-in-database-stuck-as-enqueued/583 "2015-01-22T19:52:41Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![odinserj](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/odinserj/32/648_2.png) [@odinserj](https://discuss.hangfire.io/u/odinserj)\
**Post date:** [January 28, 2015, 9:11pm UTC](https://discuss.hangfire.io/t/jobs-being-created-in-database-stuck-as-enqueued/583/17 "2015-01-28T21:11:32Z")

</div>

Shane, can you check the fix: [https://www.dropbox.com/s/k91cqf6atmjbukh/HangfireFixedRace.zip?dl=0](https://www.dropbox.com/s/k91cqf6atmjbukh/HangfireFixedRace.zip?dl=0) ? I’m not able to reproduce the source bug neither in office, nor at home ☹

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.

---

_[View the full topic](https://discuss.hangfire.io/t/jobs-being-created-in-database-stuck-as-enqueued/583)._
