The number of loops can be limited with the parametervmcj/nested_lock_loops:
Endless attempts are made to set the lock.
Maximum number of attempts to set the lock. Each attempt lasts for aboutone second. If the lock still could not be set after n number ofattempts, the lock request is rejected.
Who is allowed
Limitation for os
Limitation for db