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

Fix inconsistent synchronization of PoolSubpage.doNotDestroy #12775

Merged
merged 1 commit into from Sep 7, 2022

Conversation

chrisvest
Copy link
Contributor

Motivation:
This field is modified under lock, and thus should not be accessed (toString excepted) without locking.

Modification:
Move an assert check on PoolSubpage.doNotDestroy into a nearby critical region.

Also encapsulate the findSubpagePoolHead logic better; PoolArena now always use this method instead of that one place that was accessing the array directly. This should not have any influence on the logic.

Result:
Assert in PoolChunk is no longer racy.

Motivation:
This field is modified under lock, and thus should not be accessed (toString excepted) without locking.

Modification:
Move an assert check on PoolSubpage.doNotDestroy into a nearby critical region.

Also encapsulate the findSubpagePoolHead logic better; PoolArena now always use this method instead of that one place that was accessing the array directly.
This should not have any influence on the logic.

Result:
Assert in PoolChunk is no longer racy.
@chrisvest chrisvest added this to the 4.1.81.Final milestone Sep 6, 2022
@normanmaurer normanmaurer merged commit 341e4f1 into netty:4.1 Sep 7, 2022
@chrisvest chrisvest deleted the 4.1-pool-sync branch September 7, 2022 19:33
chrisvest added a commit that referenced this pull request Sep 7, 2022
Motivation:
This field is modified under lock, and thus should not be accessed (toString excepted) without locking.

Modification:
Move an assert check on PoolSubpage.doNotDestroy into a nearby critical region.

Also encapsulate the findSubpagePoolHead logic better; PoolArena now always use this method instead of that one place that was accessing the array directly. This should not have any influence on the logic.

Result:
Assert in PoolChunk is no longer racy.
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

2 participants