From: Darold Gilles Date: Thu, 7 Aug 2014 18:00:51 +0000 (+0200) Subject: Session count is immediately decreased when a FATAL error is received in the current... X-Git-Tag: v6.0~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=170365ef78f816923c502b1a0e728ff3f9fbfd88;p=pgbadger Session count is immediately decreased when a FATAL error is received in the current session. --- diff --git a/pgbadger b/pgbadger index 1d90a16..0fedc9d 100755 --- a/pgbadger +++ b/pgbadger @@ -183,6 +183,7 @@ my $ssh_user = ''; my $ssh_timeout = 10; my $ssh_options = "-o ConnectTimeout=$ssh_timeout -o PreferredAuthentications=hostbased,publickey"; +# OBSOLETE, to be removed # List of regex that match fatal error message that do not # generate disconnection line in log. This is to prevent # sessions in the sessions charts to increase continually. @@ -8576,6 +8577,7 @@ sub parse_log_prefix } } +# OBSOLETE: to be removed sub is_session_closed { map { return 1 if ($_[0] =~ $_); } @session_closed_msg; @@ -8603,10 +8605,8 @@ sub parse_query } # Remove session failure from current workload because there is no disconnection entry - if ( ($prefix_vars{'t_loglevel'} eq 'FATAL') - && &is_session_closed($prefix_vars{'t_query'}) ) - { - delete $current_sessions{$prefix_vars{'t_pid'}} if (!$disable_session); + if (!$disable_session && ($prefix_vars{'t_loglevel'} eq 'FATAL')) { + delete $current_sessions{$prefix_vars{'t_pid'}}; if ($extension eq 'tsung') { delete $tsung_session{$prefix_vars{'t_pid'}} }