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

telegraf swallowing panics #2341

Closed
phemmer opened this issue Jan 31, 2017 · 2 comments · Fixed by #2354
Closed

telegraf swallowing panics #2341

phemmer opened this issue Jan 31, 2017 · 2 comments · Fixed by #2354
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@phemmer
Copy link
Contributor

phemmer commented Jan 31, 2017

Bug report

Relevant telegraf.conf:

System info:

[Include Telegraf version, operating system name, and other relevant details]
Telegraf current master (738cbbd)

Relevant telegraf.conf:

[[outputs.file]]
files = ["stdout"]

[[inputs.cpu]]

Steps to reproduce:

  1. call panic("foo") from within a plugin's Gather(). For example the Gather() method on the system/cpu plugin
  2. telegraf -config /tmp/telegraf.conf -test

Expected behavior:

* Plugin: inputs.cpu, Collection 1
big nasty panic message here

Actual behavior:

* Plugin: inputs.cpu, Collection 1

Use case: [Why is this important (helps with prioritizing requests)]

I was trying to develop on a plugin, but whenever I ran telegraf, absolutely no output was produced. Eventually I figured out that my code was causing a panic, but it was rather difficult to figure out because my panic was being thrown away.

@phemmer
Copy link
Contributor Author

phemmer commented Jan 31, 2017

I'm wondering if this has been the cause of some issue reports lately that claim no metrics are being written, but no error is being produced. Such as #2331

@sparrc sparrc added this to the 1.3.0 milestone Jan 31, 2017
@sparrc sparrc added the bug unexpected problem or unintended behavior label Jan 31, 2017
sparrc added a commit that referenced this issue Feb 1, 2017
this defer function was causing telegraf to call os.Exit(0) instead of
panicking when it was supposed to.

closes #2341
sparrc added a commit that referenced this issue Feb 1, 2017
this defer function was causing telegraf to call os.Exit(0) instead of
panicking when it was supposed to.

closes #2341
@sparrc
Copy link
Contributor

sparrc commented Feb 1, 2017

AFAICT this issue only happens in --test mode

sparrc added a commit that referenced this issue Feb 1, 2017
this defer function was causing telegraf to call os.Exit(0) instead of
panicking when it was supposed to.

closes #2341
sparrc added a commit that referenced this issue Feb 2, 2017
this defer function was causing telegraf to call os.Exit(0) instead of
panicking when it was supposed to.

closes #2341
sparrc added a commit that referenced this issue Feb 2, 2017
this defer function was causing telegraf to call os.Exit(0) instead of
panicking when it was supposed to.

closes #2341
sparrc added a commit that referenced this issue Feb 2, 2017
this defer function was causing telegraf to call os.Exit(0) instead of
panicking when it was supposed to.

closes #2341
bullshit pushed a commit to bullshit/telegraf that referenced this issue Feb 2, 2017
this defer function was causing telegraf to call os.Exit(0) instead of
panicking when it was supposed to.

closes influxdata#2341
mlindes pushed a commit to Comcast/telegraf that referenced this issue Feb 6, 2017
this defer function was causing telegraf to call os.Exit(0) instead of
panicking when it was supposed to.

closes influxdata#2341
maxunt pushed a commit that referenced this issue Jun 26, 2018
this defer function was causing telegraf to call os.Exit(0) instead of
panicking when it was supposed to.

closes #2341
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