Pulling from the queue can raise serialization error
The worker process can crash if the call to Queue.pull
raise a DatabaseOperationalError
. This can happen even with an autocommit transaction because the query is updating the queue table (see https://stackoverflow.com/a/9984640/687601).
So we should catch such exception and retry pulling.