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

Compare both PID and process start time to avoid issues with immediate PID reuse on Linux #3773

Merged
merged 2 commits into from
Nov 23, 2023

Conversation

drNowak
Copy link

@drNowak drNowak commented Nov 12, 2020

When PID is reused on Linux between two cycles, the data from the old process will not be cleared and new process will reuse the previous data. This is causing issues like negative CPU.

We have seen those issues at scale in Google Cloud, and this patch fixed the issue completely. This fix is tested at scale for 6 months already.

ChangeLog: processes.c: fix negative CPU reporting caused by PID reuse on Linux.

@drNowak drNowak requested a review from a team as a code owner November 12, 2020 09:51
@drNowak
Copy link
Author

drNowak commented Nov 12, 2020

I have run contrib/format.sh src/processes.c and added commit.

@drNowak drNowak closed this Nov 12, 2020
@drNowak drNowak reopened this Nov 12, 2020
@octo octo added Bug A genuine bug linux only labels Apr 26, 2021
Copy link
Member

@octo octo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Krzysztof!

Copy link

@vincele vincele left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@drNowak
Copy link
Author

drNowak commented May 4, 2023

Hey guys, I cannot merge myself, please merge.

@octo
Copy link
Member

octo commented Nov 23, 2023

Rebased on main, now waiting for CI results.

@octo
Copy link
Member

octo commented Nov 23, 2023

As far as I can see, the build failures are unrelated to this PR.

@octo octo merged commit 1ef4b4d into collectd:main Nov 23, 2023
9 of 27 checks passed
@octo octo added Fix A pull request fixing a bug and removed Bug A genuine bug labels Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix A pull request fixing a bug linux only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants