Skip to content

Fix inconsistent synchronization of PoolSubpage.doNotDestroy#12775

Merged
normanmaurer merged 1 commit intonetty:4.1from
chrisvest:4.1-pool-sync
Sep 7, 2022
Merged

Fix inconsistent synchronization of PoolSubpage.doNotDestroy#12775
normanmaurer merged 1 commit intonetty:4.1from
chrisvest:4.1-pool-sync

Conversation

@chrisvest
Copy link
Copy Markdown
Member

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
@chrisvest chrisvest requested a review from franz1981 September 6, 2022 20:39
@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.

2 participants