Skip to content

Commit

Permalink
feat: Harvest should reduce batch size and retry when ONTAP times out
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrinds committed Mar 25, 2024
1 parent 149999c commit 7ecc80f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/collectors/zapiperf/zapiperf.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,14 +465,14 @@ func (z *ZapiPerf) PollData() (map[string]*matrix.Matrix, error) {
if err != nil {
errMsg := err.Error()
// if ONTAP complains about batch size, use a smaller batch size
if strings.Contains(errMsg, "resource limit exceeded") && z.batchSize > 100 {
if strings.EqualFold(errMsg, "resource limit exceeded") && z.batchSize > 100 {
z.Logger.Error().Err(err).
Int("oldBatchSize", z.batchSize).
Int("newBatchSize", z.batchSize-100).
Msg("Changed batch_size")
z.batchSize -= 100
return nil, nil
} else if strings.Contains(errMsg, "Timeout: Operation") && z.batchSize > 100 {
} else if strings.EqualFold(errMsg, "Timeout: Operation") && z.batchSize > 100 {
z.Logger.Error().Err(err).
Int("oldBatchSize", z.batchSize).
Int("newBatchSize", z.batchSize-100).
Expand Down

0 comments on commit 7ecc80f

Please sign in to comment.