Comment 0 for bug 1506071

Revision history for this message
Alexander Gordeev (a-gordeev) wrote :

if one starts 2 or more instances of fuel-agent simultaneously, then fuel-agent could fail on loop device allocation.

failure scenario is pretty simple.
1) fuel-agent finds first free loop device. For the case of multiple instances, some of instances could find the same loop device as free.
2) fuel-agent allocates it. Once it's being allocated, it becomes to be busy and not free. Other instances which previously found the same loop device as free will throw an exception, just because one of fuel-agent instances already occupied that loop device.

To fix that, retry should be added to this piece of code: https://github.com/stackforge/fuel-agent/blob/master/fuel_agent/manager.py#L608-L615

the fix is simple:
1) find free loop device
2) allocate it. If you can't allocate it and got ProcessExecutionError, then go to 1) until max retry count is not met.
max retry count should be available as a config parameter.