Skip to content

fix tail input seeking when used with pipe#2090

Merged
sparrc merged 2 commits intoinfluxdata:masterfrom
phemmer:fix-tail-pipe
Dec 16, 2016
Merged

fix tail input seeking when used with pipe#2090
sparrc merged 2 commits intoinfluxdata:masterfrom
phemmer:fix-tail-pipe

Conversation

@phemmer
Copy link
Contributor

@phemmer phemmer commented Nov 26, 2016

Required for all PRs:

  • CHANGELOG.md updated (we recommend not updating this until the PR has been approved by a maintainer)
  • Sign CLA (if not already signed)

Fixes the tail input plugin so that it works with named pipes.
Also fixes errors being discarded when tailer dies.

There is however still one problem with reading from a pipe. If there is nobody has the pipe open for writing, when telegraf opens it for read, it'll block.
The simple solution to this is to create the goroutine before opening the file. However this means that the Start() func will return, and then the goroutine potentially error and die immediately due to some other reason (e.g. permission errors). However we can use the Accumulator.AddError() method to report the error. Not sure if there would be any end-user noticeable effect from such a change.

Note that there appears to be a different error in that if the tailer dies, it doesn't start back up, thus requiring a restart of telegraf. But that's out of scope of this issue.

Fixes #2089

@sparrc sparrc added this to the 1.2.0 milestone Nov 28, 2016
@sparrc sparrc merged commit ecbc634 into influxdata:master Dec 16, 2016
@phemmer phemmer deleted the fix-tail-pipe branch December 16, 2016 15:07
njwhite pushed a commit to njwhite/telegraf that referenced this pull request Jan 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

inputs.tail can't read from named pipe

2 participants