Skip to content

processes: Don't return error if process exited#1283

Merged
sparrc merged 1 commit intoinfluxdata:masterfrom
PierreF:processes-improvment
May 26, 2016
Merged

processes: Don't return error if process exited#1283
sparrc merged 1 commit intoinfluxdata:masterfrom
PierreF:processes-improvment

Conversation

@PierreF
Copy link
Contributor

@PierreF PierreF commented May 26, 2016

Required for all PRs:

  • CHANGELOG.md updated
  • Sign CLA (if not already signed)

I've sometime the following error:

$ grep telegraf /var/log/syslog |grep Error
May 26 06:28:20 hostname telegraf[15844]: 2016/05/26 06:28:20 Error in input [processes]: open /proc/16683/stat: no such file or directory
May 26 07:21:30 hostname telegraf[15844]: 2016/05/26 07:21:30 Error in input [processes]: read /proc/19975/stat: no such process
May 26 09:29:40 hostname telegraf[15844]: 2016/05/26 09:29:40 Error in input [processes]: read /proc/27969/stat: no such process
May 26 09:40:40 hostname telegraf[15844]: 2016/05/26 09:40:40 Error in input [processes]: read /proc/28637/stat: no such process

This cause the processes plugin to skip all metrics for the affected collection round.

This PR add a second file.IsDir() during error handling, if path is no longer a directory then the process must have terminated so it continues instead of returning an error

@sparrc
Copy link
Contributor

sparrc commented May 26, 2016

thx @PierreF

@sparrc sparrc merged commit d5add07 into influxdata:master May 26, 2016
@PierreF PierreF deleted the processes-improvment branch August 4, 2018 13:22
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.

2 participants