Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inputs.tail can't read from named pipe #2089

Closed
phemmer opened this issue Nov 26, 2016 · 0 comments · Fixed by #2090
Closed

inputs.tail can't read from named pipe #2089

phemmer opened this issue Nov 26, 2016 · 0 comments · Fixed by #2090
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@phemmer
Copy link
Contributor

phemmer commented Nov 26, 2016

Bug report

Relevant telegraf.conf:

[[inputs.tail]]
  files = ["/var/tmp/foo.fifo"]
  from_beginning = true
  data_format = "influx"

System info:

telegraf-1.0.1_7_g00637b3-0
CentOS/7

Steps to reproduce:

  1. mkfifo /var/tmp/foo.fifo
  2. Launch telegraf with above config

Expected behavior:

To tail the pipe

Actual behavior:

Doesn't tail the pipe

Additional info:

No error output is generated at all. Telegraf silently closes the file descriptor and does nothing.

[pid 27416] openat(AT_FDCWD, "/var/tmp/foo.fifo", O_RDONLY|O_CLOEXEC) = 4
[pid 27416] futex(0xc8200d9108, FUTEX_WAKE, 1) = 1
[pid 27420] <... futex resumed> )       = 0
[pid 27414] <... select resumed> )      = 0 (Timeout)
[pid 27416] futex(0x204db78, FUTEX_WAKE, 1 <unfinished ...>
[pid 27414] select(0, NULL, NULL, NULL, {0, 20} <unfinished ...>
[pid 27416] <... futex resumed> )       = 1
[pid 27420] futex(0xc8200f6108, FUTEX_WAKE, 1 <unfinished ...>
[pid 27418] <... futex resumed> )       = 0
[pid 27416] write(2, "2016/11/26 14:38:31 Input [tail] gathered metrics, (1m0s interval) in 28.988\302\265s\n", 80 <unfinished ...>
2016/11/26 14:38:31 Input [tail] gathered metrics, (1m0s interval) in 28.988µs
[pid 27414] <... select resumed> )      = 0 (Timeout)
[pid 27416] <... write resumed> )       = 80
[pid 27414] select(0, NULL, NULL, NULL, {0, 20} <unfinished ...>
[pid 27416] lseek(4, 0, SEEK_SET)       = -1 ESPIPE (Illegal seek)
[pid 27420] <... futex resumed> )       = 1
[pid 27419] <... futex resumed> )       = 0
[pid 27418] futex(0xc8200d8d08, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 27419] futex(0xc8200d8d08, FUTEX_WAKE, 1 <unfinished ...>
[pid 27420] futex(0xc8200d9108, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 27418] <... futex resumed> )       = -1 EAGAIN (Resource temporarily unavailable)
[pid 27419] <... futex resumed> )       = 0
[pid 27419] futex(0x204db78, FUTEX_WAIT, 0, {0, 199933916} <unfinished ...>
[pid 27418] futex(0xc8200d8d08, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 27416] write(2, "2016/11/26 14:38:31 Seeked /var/tmp/foo.fifo - &{Offset:0 Whence:0}\n", 81 <unfinished ...>
[pid 27414] <... select resumed> )      = 0 (Timeout)
2016/11/26 14:38:31 Seeked /var/tmp/foo.fifo - &{Offset:0 Whence:0}
[pid 27414] select(0, NULL, NULL, NULL, {0, 20} <unfinished ...>
[pid 27416] <... write resumed> )       = 81
[pid 27416] futex(0xc8200d8d08, FUTEX_WAKE, 1) = 0
[pid 27416] close(4)                    = 0

I suspect this can be fixed by not attempting to perform a seek if from_beginning = true.
It seems we also have an issue where the error is silently discarded.

@sparrc sparrc added the bug unexpected problem or unintended behavior label Nov 28, 2016
@sparrc sparrc added this to the 1.2.0 milestone Nov 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants