Batches are not initialized

Once in a while, Hangfire stops working on our test environment, and tasks fail with the error message “Batches are not initialized”. An app pool recycle fixes the problem.

For some reason, this does not seem to happen in our production environment.

Does anybody have a clue what’s going on? Searching for this issue brings up nothing.