From fe14417d176369207afd62bbb70abb41573b74a9 Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 4 Mar 2010 19:35:14 +0000 Subject: [PATCH] "conflict" connection errors shouldn't influence hammering. --- perl/lib/Thrasher/Component.pm | 6 +++++- perl/lib/Thrasher/ConnectionManager.pm | 15 ++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/perl/lib/Thrasher/Component.pm b/perl/lib/Thrasher/Component.pm index 1e585bf..2584738 100644 --- a/perl/lib/Thrasher/Component.pm +++ b/perl/lib/Thrasher/Component.pm @@ -971,7 +971,11 @@ sub login { } } if ($USE_CONNECTION_MANAGER) { - Thrasher::ConnectionManager::connection_failure(); + my $local_only = 0; + if ($error ne 'conflict') { + $local_only = 1; + } + Thrasher::ConnectionManager::connection_failure($local_only); } return; } diff --git a/perl/lib/Thrasher/ConnectionManager.pm b/perl/lib/Thrasher/ConnectionManager.pm index e31ef80..6dd3a80 100644 --- a/perl/lib/Thrasher/ConnectionManager.pm +++ b/perl/lib/Thrasher/ConnectionManager.pm @@ -352,14 +352,19 @@ sub connection_success { } sub connection_failure { + my ($local_only) = @_; + $SIMULTANEOUS_CONNECT_BOUND++; debug('Connection failure managed.'); - my $current_schedule = schedule_request; - if ($current_schedule->[0] != 30) { - $failure->add(10); - } else { - log("Declining to increment failure."); + if (! $local_only) { + my $current_schedule = schedule_request; + if ($current_schedule->[0] != 30) { + $failure->add(10); + } + else { + log("Declining to increment failure."); + } } } -- 2.11.4.GIT