From 15c4ce6a6189599347c1d09bd10ae5439f2b9f48 Mon Sep 17 00:00:00 2001 From: dreamlike-ocean Date: Wed, 13 May 2026 22:11:10 +0800 Subject: [PATCH] Fix HybridJacksonPool stack node publication race --- .../main/java/io/vertx/core/json/jackson/HybridJacksonPool.java | 2 +- .../java21/io/vertx/core/json/jackson/v3/HybridJacksonPool.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vertx-core/src/main/java/io/vertx/core/json/jackson/HybridJacksonPool.java b/vertx-core/src/main/java/io/vertx/core/json/jackson/HybridJacksonPool.java index af0c498434a..0056d54e604 100644 --- a/vertx-core/src/main/java/io/vertx/core/json/jackson/HybridJacksonPool.java +++ b/vertx-core/src/main/java/io/vertx/core/json/jackson/HybridJacksonPool.java @@ -141,8 +141,8 @@ public void releasePooled(BufferRecycler recycler) { Node next = topStacks.get(vThreadBufferRecycler.slot); while (true) { newHead.level = next == null ? 1 : next.level + 1; + newHead.next = next; if (topStacks.compareAndSet(vThreadBufferRecycler.slot, next, newHead)) { - newHead.next = next; return; } else { next = topStacks.get(vThreadBufferRecycler.slot); diff --git a/vertx-core/src/main/java21/io/vertx/core/json/jackson/v3/HybridJacksonPool.java b/vertx-core/src/main/java21/io/vertx/core/json/jackson/v3/HybridJacksonPool.java index 77fd5132674..d2dcffc8510 100644 --- a/vertx-core/src/main/java21/io/vertx/core/json/jackson/v3/HybridJacksonPool.java +++ b/vertx-core/src/main/java21/io/vertx/core/json/jackson/v3/HybridJacksonPool.java @@ -136,8 +136,8 @@ public void releasePooled(BufferRecycler recycler) { Node next = topStacks.get(vThreadBufferRecycler.slot); while (true) { newHead.level = next == null ? 1 : next.level + 1; + newHead.next = next; if (topStacks.compareAndSet(vThreadBufferRecycler.slot, next, newHead)) { - newHead.next = next; return; } else { next = topStacks.get(vThreadBufferRecycler.slot);