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

Use a static FastThreadLocal in CombinerExecutor instead of a instance field #5080

Merged
merged 1 commit into from Jan 29, 2024

Conversation

vietj
Copy link
Member

@vietj vietj commented Jan 26, 2024

The CombinerExecutor class creates an instance of FastThreadLocal for each combiner executor leading to an increase of the InternalThreadLocalMap index. Consequently each thread local map of FastThreadLocalThread will get a new map sized accordingly, leading to an eventual memory leak.

Use a static FastThreadLocal in CombinerExecutor instead of a instance field, the data structure stored in this thread local map keeps track of the CombinerExecutor running in order to allow interleaved execution of CombinerExecutor post tasks without interfering each other. The structure is optimized for the most frequent case.

Fixes https://access.redhat.com/security/cve/CVE-2024-1023

Copy link
Contributor

@franz1981 franz1981 left a comment

Choose a reason for hiding this comment

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

LGTM just for "fun" try running the test suite adding an assert in case of "others" is allocated (disable the test which make it happen eh!)

@franz1981
Copy link
Contributor

This is related #5078

@vietj vietj added this to the 4.5.2 milestone Jan 26, 2024
@vietj vietj added the bug label Jan 26, 2024
@vietj vietj self-assigned this Jan 26, 2024
… each combiner executor leading to an increase of the InternalThreadLocalMap index. Consequently each thread local map of FastThreadLocalThread will get a new map sized accordingly, leading to an eventual memory leak.

Use a static FastThreadLocal in CombinerExecutor instead of a instance field, the data structure stored in this thread local map keeps track of the CombinerExecutor running in order to allow interleaved execution of CombinerExecutor post tasks without interfering each other. The structure is optimized for the most frequent case.
@vietj vietj force-pushed the use-static-fast-thread-local-in-combiner-executor-4.x branch from b5b6055 to d588fca Compare January 29, 2024 07:14
@vietj vietj merged commit 665ceba into 4.x Jan 29, 2024
7 checks passed
@vietj vietj deleted the use-static-fast-thread-local-in-combiner-executor-4.x branch January 29, 2024 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants