Fixes per Daniel's review

This commit is contained in:
Brian Fraser
2013-04-16 13:01:30 -03:00
parent d8a3d217ef
commit bd37cb252f
3 changed files with 38 additions and 19 deletions

View File

@@ -1129,6 +1129,7 @@ if ( PTDEBUG ) {
# ###########################################################################
{
package Lmo::Utils;
use strict;
use warnings qw( FATAL all );
require Exporter;
@@ -1136,7 +1137,12 @@ our (@ISA, @EXPORT, @EXPORT_OK);
BEGIN {
@ISA = qw(Exporter);
@EXPORT = @EXPORT_OK = qw(_install_coderef _unimport_coderefs _glob_for _stash_for);
@EXPORT = @EXPORT_OK = qw(
_install_coderef
_unimport_coderefs
_glob_for
_stash_for
);
}
{
@@ -1320,7 +1326,6 @@ sub meta {
return Lmo::Meta->new(class => $class);
}
1;
}
# ###########################################################################
@@ -3264,10 +3269,24 @@ sub parse_event {
$new_query = 1;
}
elsif ( $curr->[INFO] && defined $curr->[TIME]
&& $query_start - $etime - $prev->[START] > $fudge ) {
PTDEBUG && _d('Query restarted; new query',
$query_start, $etime, $prev->[START], $fudge);
$new_query = 1;
&& $query_start - $etime - $prev->[START] > $fudge)
{
my $ms = $self->{MasterSlave};
my $is_repl_thread = $ms->is_replication_thread({
Command => $curr->[COMMAND],
User => $curr->[USER],
State => $curr->[STATE],
Id => $curr->[ID]});
if ( $is_repl_thread ) {
PTDEBUG &&
_d(q{Query has restarted but it's a replication thread, ignoring});
}
else {
PTDEBUG && _d('Query restarted; new query',
$query_start, $etime, $prev->[START], $fudge);
$new_query = 1;
}
}
if ( $new_query ) {
@@ -4951,6 +4970,8 @@ use warnings FATAL => 'all';
use English qw(-no_match_vars);
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
use Time::HiRes qw(sleep);
sub new {
my ( $class, %args ) = @_;
my $self = {