Sometimes background jobs get stuck in the processing queue

I’m having Hangfire with multiple servers, and each server is running with 6 workers.
I’m using Docker Swarm to manage and run the instances of the servers, Some times we face an issue that some background jobs stuck for long time in the processing queue without any progress until we restart the servers or re-enqueue the job again manually from the dashboard’s UI.