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

processmanager: simplify API and return early #325

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

florianl
Copy link
Contributor

This change can be reviewed commit by commit.

processmanager: make ProcessPIDExit private
The recommended way to report new mappings or exited process SynchronizeProcess() should be used.

processmanager: return early in processPIDExit()
Return early from processPIDExit() if pm.pidToProcessInfo is not aware of a paritcular PID. This early return is possible, as processPIDExit() holds the global ProcessManager lock and entries in pm.pidToProcessInfo, pm.interpreters and pm.exitEvents are cleared in ProcessedUntil() while holding the lock.

The recommended way to report new mappings or exited process SynchronizeProcess() should be used.

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Return early from processPIDExit() if pm.pidToProcessInfo is not aware of a paritcular PID. This early return is possible, as processPIDExit() holds the global ProcessManager lock and entries in pm.pidToProcessInfo, pm.interpreters and pm.exitEvents are cleared in ProcessedUntil() while holding the lock.

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Copy link
Member

@christos68k christos68k left a comment

Choose a reason for hiding this comment

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

Need to do a more in depth pass to verify we're not introducing any races

processmanager/processinfo.go Outdated Show resolved Hide resolved
Co-authored-by: Christos Kalkanis <christos.kalkanis@elastic.co>
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