Duplicate processing
When the __queue__ is used to process sale, purchase and capture payments, we can see a concurrent issue with those processing method. It is not directly linked to the __queue__ but it allow to expose it (e.g. process multiple time a sale without any worker and then start a worker which will process in parallel the same sale multiple times).
I think we should lock the records for update like we do in Move.assign_try. At first a portable fix should be implemented and after we could probably have a method on the ModelSQL to lock instances.