Skip to content

Commit

Permalink
Merge branch 'versions/0.10' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
rafrombrc committed Sep 16, 2015
2 parents eb2042c + 511afaf commit 5b00263
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Bug Handling
* Fixed bug where a SandboxInput configured with a `ticker_interval` would
get stuck in an infinite loop on shutdown (#1705).

* Fixed race condition in the BufferReader's queue file lookup code (#1639).

* Changes in StatAccumInput and FileOutput tests to minimize intermittent
Travis failures.

Expand Down
11 changes: 7 additions & 4 deletions pipeline/queue_buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,17 +319,20 @@ func (br *BufferReader) getFileFromId(id uint) (file *os.File, foundId uint,
return file, foundId, err
}

// If we got this far there's no file matching our id, try to find the
// next one above.
// If we got this far, there was no file matching our id when we checked.
// It might, however, have been created after we checked, but before we get
// our id list back from the sortedBufferIds call below. This is fine,
// we'll still find and return it.
ids := sortedBufferIds(br.queue)
if len(ids) == 0 || ids[len(ids)-1] < id {
// No log file for us, not an error.
return nil, 0, nil
}

// Increment until we find an id greater than what was requested.
// Increment until we find an id greater than or equal to what was
// requested.
for _, val := range ids {
if val > id {
if val >= id {
foundId = val
break
}
Expand Down

0 comments on commit 5b00263

Please sign in to comment.