Skip to content

Fix HybridJacksonPool stack node publication race#6112

Merged
tsegismont merged 1 commit into
eclipse-vertx:masterfrom
dreamlike-ocean:fix_jackson_race
May 13, 2026
Merged

Fix HybridJacksonPool stack node publication race#6112
tsegismont merged 1 commit into
eclipse-vertx:masterfrom
dreamlike-ocean:fix_jackson_race

Conversation

@dreamlike-ocean
Copy link
Copy Markdown

@dreamlike-ocean dreamlike-ocean commented May 13, 2026

Motivation:

Fixes a race in HybridJacksonPool.StripedLockFreePool#releasePooled. #6111

The virtual-thread pool was publishing a newly created stack node with CAS before assigning its next pointer. A concurrent acquire could observe and pop that partially initialized node, see next == null, and drop the rest of the stack.
This change initializes newHead.next before the CAS, so the node is fully linked before it becomes visible to other threads.

Conformance:

I have signed the Eclipse Contributor Agreemen

Copy link
Copy Markdown
Member

@tsegismont tsegismont left a comment

Choose a reason for hiding this comment

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

LGTM, thank you @dreamlike-ocean !

@tsegismont tsegismont added this to the 5.1.0 milestone May 13, 2026
@tsegismont tsegismont merged commit 064ee05 into eclipse-vertx:master May 13, 2026
10 of 15 checks passed
tsegismont added a commit that referenced this pull request May 13, 2026
Co-authored-by: Mengyang Li <56702218+dreamlike-ocean@users.noreply.github.com>
tsegismont added a commit that referenced this pull request May 13, 2026
Co-authored-by: Mengyang Li <56702218+dreamlike-ocean@users.noreply.github.com>
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