UBUNTU:SAUCE: exec: fix lockup because retry loop may never exit
BugLink: https://launchpad.net/bugs/1730717
My early fix for bug LP#
1672819 could get stuck in an infinite
retry loop causing lockups. Currently the retry is aggressively
spinning on a check and will never abort. Relax the aggressive
retry by adding a small interruptible delay and limit the number
of retries.
I've analyzed the retries and 95% of the cases on an 8 CPU Xeon
host never hit the retry loop and less that 0.5% of retries are
ever more than 1 retry using the original reproducer program.
Considering that the reproducer is an extreeme case of forcing
the race condition I believe we now have a suitable balance of
non-aggressive CPU eating retries and a mechanism to bail out
after enough retries and avoid a lockup.
Admittedly this workaround is a bit of an ugly hack, but the
retry path is never executed for the majority of use cases and
only hits the retry/delay for the racy condition we hit with the
original bug.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>