Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
camdencheek committed Sep 8, 2020
1 parent e8ca3a8 commit 48bbe84
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions operator/builtin/input/file/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ func TestFileSource_OffsetsAfterRestart(t *testing.T) {

// Start the source and expect a message
require.NoError(t, source.Start())
defer source.Stop()
waitForMessage(t, logReceived, "testlog1")

// Restart the source. Stop and build a new
Expand Down
9 changes: 5 additions & 4 deletions operator/builtin/input/file/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,18 @@ type FileReader struct {
LastSeenFileSize int64
Offset int64

// This lock must be held any time an exported field
// on FileReader is written to, or any time it is read from
// outside the ReadToEnd goroutine
sync.Mutex `json:"-"`

fileInput *InputOperator

decoder *encoding.Decoder
decodeBuffer []byte

readInProgress bool

// This lock must be held any time an exported field
// on FileReader is written to, or any time it is read from
// outside the ReadToEnd goroutine
sync.Mutex `json:"-"`
*zap.SugaredLogger `json:"-"`
}

Expand Down

0 comments on commit 48bbe84

Please sign in to comment.