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

Detect process id reuse #35

Merged
merged 1 commit into from Sep 4, 2022
Merged

Detect process id reuse #35

merged 1 commit into from Sep 4, 2022

Conversation

javierhonduco
Copy link
Owner

Process IDs (PIDs) are reused on Linux, so it's possible that we start profiling
a Ruby process with some PID and later on, while still profiling, this
process exits and a new one is spawned with this same PID.

The profiling information will be wrong. rbperf has some guardrails to
help here, such as ensuring that method and path names are valid
unicode, otherwise we consider the stack to be invalid, but it would be
best to actively ensure we don't have a race condition here.

By using the pid + start_time of the process, we should be able to have
a truly unique identifier of every process

Signed-off-by: Francisco Javier Honduvilla Coto javierhonduco@gmail.com

Process IDs (PIDs) are reused on Linux, so it's possible that we start profiling
a Ruby process with some PID and later on, while still profiling, this
process exits and a new one is spawned with this same PID.

The profiling information will be wrong. rbperf has some guardrails to
help here, such as ensuring that method and path names are valid
unicode, otherwise we consider the stack to be invalid, but it would be
best to actively ensure we don't have a race condition here.

By using the `pid + start_time` of the process, we should be able to have
a truly unique identifier of every process

Signed-off-by: Francisco Javier Honduvilla Coto <javierhonduco@gmail.com>
@javierhonduco javierhonduco merged commit 272c8f3 into main Sep 4, 2022
@javierhonduco javierhonduco deleted the pid-race-fix branch September 4, 2022 12:36
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.

None yet

1 participant