mirror of
https://github.com/ovh/the-bastion.git
synced 2025-10-25 21:06:40 +08:00
fix: groupdel: false positive in lock contention detection
Groups that were containing 'lock' or 'retry' in their name would falsely trigger the /etc/passwd and /etc/group lock contention detection, due to their presence in the output of the system command, implying several retries that were not needed.
This commit is contained in:
parent
b40a2fd6e3
commit
a6488ee6fb
1 changed files with 8 additions and 3 deletions
|
|
@ -47,9 +47,14 @@ sub _sys_autoretry {
|
||||||
my $fnret;
|
my $fnret;
|
||||||
foreach my $try (1 .. 10) {
|
foreach my $try (1 .. 10) {
|
||||||
$fnret = OVH::Bastion::execute(%params);
|
$fnret = OVH::Bastion::execute(%params);
|
||||||
if ( ($fnret->value && $fnret->value->{'sysret'} == 10)
|
if (
|
||||||
|| ($fnret->value && $fnret->value->{'stdout'} && grep { /retry|lock/i } @{$fnret->value->{'stdout'}})
|
($fnret->value && $fnret->value->{'sysret'} == 10)
|
||||||
|| ($fnret->value && $fnret->value->{'stderr'} && grep { /retry|lock/i } @{$fnret->value->{'stderr'}}))
|
|| (
|
||||||
|
($fnret->value && $fnret->value->{'sysret'} != 0)
|
||||||
|
&& ( ($fnret->value->{'stdout'} && grep { /retry|lock/i } @{$fnret->value->{'stdout'}})
|
||||||
|
|| ($fnret->value->{'stderr'} && grep { /retry|lock/i } @{$fnret->value->{'stderr'}}))
|
||||||
|
)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
# too much concurrency, sleep a bit and retry
|
# too much concurrency, sleep a bit and retry
|
||||||
warn_syslog('Too much concurrency on try '
|
warn_syslog('Too much concurrency on try '
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue