Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Do not stop collecting mysql statistics because of timeout #1346

Merged
merged 3 commits into from
Sep 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions modules/mysql/collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package mysql
import (
"context"
"database/sql"
"errors"
"fmt"
"strconv"
"strings"
Expand Down Expand Up @@ -68,17 +69,15 @@ func (m *MySQL) collect() (map[string]int64, error) {
// TODO: perhaps make a decisions based on privileges? (SHOW GRANTS FOR CURRENT_USER();)
if m.doSlaveStatus {
if err := m.collectSlaveStatus(mx); err != nil {
m.Errorf("error on collecting slave status: %v", err)
// TODO: shouldn't disable on any error
m.doSlaveStatus = false
m.Warningf("error on collecting slave status: %v", err)
m.doSlaveStatus = errors.Is(err, context.DeadlineExceeded)
}
}

if m.doUserStatistics {
if err := m.collectUserStatistics(mx); err != nil {
m.Errorf("error on collecting user statistics: %v", err)
// TODO: shouldn't disable on any error
m.doUserStatistics = false
m.Warningf("error on collecting user statistics: %v", err)
m.doUserStatistics = errors.Is(err, context.DeadlineExceeded)
}
}

Expand Down
Loading