mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-05-17 01:01:27 +08:00
merged pt-table-sync-fails-to-close-one-db-handle-1401399
This commit is contained in:
@@ -11039,6 +11039,12 @@ sub disconnect {
|
||||
my $dbh = $host->{$thing};
|
||||
next unless $dbh;
|
||||
delete $dsn_for{$dbh};
|
||||
# The following is for when misc_dbh loses
|
||||
# connection due to timeout. Since it has nothing
|
||||
# to commit we avoid reporting an error.
|
||||
if ( $thing eq 'misc_dbh' && !$dbh->ping() ) {
|
||||
next;
|
||||
}
|
||||
$dbh->commit() unless $dbh->{AutoCommit};
|
||||
$dbh->disconnect();
|
||||
PTDEBUG && _d('Disconnected dbh', $dbh);
|
||||
|
||||
Reference in New Issue
Block a user