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

Avoid buffer race conditions in CGroups #5129

Merged
merged 2 commits into from
May 28, 2024
Merged

Conversation

RussKie
Copy link
Member

@RussKie RussKie commented Apr 29, 2024

Fixes #5114

Microsoft Reviewers: Open in CodeFlow

@RussKie RussKie requested a review from mobratil April 29, 2024 06:07
@RussKie RussKie changed the title Correct tests decorations Avoid buffer race conditions in CGroups Apr 29, 2024
@mobratil
Copy link
Contributor

@RussKie can we use object pool instead of having it thread local?
I'm a bit worried that if the methods are invoked each time from a different thread it will create a new buffer every time.
Having an object pool instead will reuse the same buffer. The new buffer will be created only when there' no buffer in the pool which will rarely happen (only in case of contention).

@RussKie RussKie force-pushed the fix_5114 branch 2 times, most recently from f3a2224 to 01fe846 Compare May 17, 2024 01:37
@RussKie
Copy link
Member Author

RussKie commented May 17, 2024

@mobratil what you think of this?

@mobratil
Copy link
Contributor

@RussKie Now it looks good, thanks

@RussKie RussKie marked this pull request as ready for review May 22, 2024 11:29
@RussKie RussKie marked this pull request as draft May 22, 2024 11:32
@RussKie RussKie marked this pull request as ready for review May 24, 2024 07:23
@RussKie RussKie merged commit a06edbd into dotnet:main May 28, 2024
6 checks passed
@RussKie RussKie deleted the fix_5114 branch May 28, 2024 22:28
@github-actions github-actions bot locked and limited conversation to collaborators Jun 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Buffer in CGroups parser can get corrupted
3 participants