Prevent running concurrent Capsule Sync against the same Capsule
Description of problem:
There are really no locks preventing to run more Capsule Sync tasks against the same Capsule. That is very dangerous, as running this many times (i.e. due to an operator mistake) on a Satellite with hundreds or thousands of repos, the level of concurrency in dynflow (and also on the Capsule to some extend) boils the server(s).
(theoretically concurrent capsule sync might affect each other, I guess, so another reason to prevent it - apart of the fact it is ridiculous)
Version-Release number of selected component (if applicable):
any incl. 6.3.1
Steps to Reproduce:
1. Have an external Capsule
for i in 1 2 3 4 5; do
hammer capsule content synchronize --id=2 --async
3. Wait a minute, check tasks running
3. shows multiple CapsuleSync tasks running against the same Capsule.
2. 2nd and further CapsuleSync request should failed with "Required lock already taken" like error.
3. No concurrent CapsuleSync tasks against the same Capsule.