Skip to content

Commit

Permalink
Merge branch 'release-128tech-1.22' into release-128tech-1.22.100-mul…
Browse files Browse the repository at this point in the history
…tiarch-support
  • Loading branch information
sunanj-JNPR committed Jan 16, 2025
2 parents 6f35401 + 11e50a6 commit b4cc7dd
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions plugins/inputs/t128_tank/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,12 @@ func (r *Reader) readFromTank(readCtx context.Context, startingIndex index) (err

var parseErr error
var messages []*IndexedMessage

parseLoop:
for {
select {
case <-readCtx.Done():
r.log.Errorf("%s read routine done", r.topic)
return nil
break parseLoop
default:
}

Expand All @@ -281,10 +281,20 @@ func (r *Reader) readFromTank(readCtx context.Context, startingIndex index) (err
}
select {
case <-readCtx.Done():
return nil
break parseLoop
case r.sendChan <- collectedMessages:
}
}
if cmdErr := cmd.Wait(); cmdErr != nil {
var exitErr *exec.ExitError
if errors.As(cmdErr, &exitErr) {
r.log.Errorf("%s tank read command exited with error: %s", r.topic, exitErr.Error())
} else {
r.log.Errorf("%s tank read command exited with error: %s", r.topic, cmdErr)
}
}

return parseErr
}

func (i *IndexedMessage) IsValid() bool {
Expand Down

0 comments on commit b4cc7dd

Please sign in to comment.