Skip to content

Commit b841f0b

Browse files
authored
Update BlockHound rules for Netty 4.2 (#6344)
`AdaptivePoolingAllocator.allocate()` is reported as a blocking operation because it calls `StampedLock.writeLock()`. However, since that is used solely for synchronization purposes, the report can be considered a false positive. https://github.com/line/armeria/actions/runs/16767389726/job/47475215110?pr=6341 ```java java.lang.Exception: jdk.internal.misc.Unsafe#park at com.linecorp.armeria.internal.testing.InternalTestingBlockHoundIntegration.writeBlockingMethod(InternalTestingBlockHoundIntegration.java:86) at reactor.blockhound.BlockHound$Builder.lambda$install$8(BlockHound.java:488) at reactor.blockhound.BlockHoundRuntime.checkBlocking(BlockHoundRuntime.java:89) at java.base/jdk.internal.misc.Unsafe.park(Unsafe.java) at java.base/java.util.concurrent.locks.LockSupport.park(LockSupport.java:221) at java.base/java.util.concurrent.locks.StampedLock.acquireWrite(StampedLock.java:1251) at java.base/java.util.concurrent.locks.StampedLock.writeLock(StampedLock.java:480) at io.netty.buffer.AdaptivePoolingAllocator$Magazine.free(AdaptivePoolingAllocator.java:1043) at io.netty.buffer.AdaptivePoolingAllocator$MagazineGroup.tryExpandMagazines(AdaptivePoolingAllocator.java:450) at io.netty.buffer.AdaptivePoolingAllocator$MagazineGroup.allocate(AdaptivePoolingAllocator.java:417) at io.netty.buffer.AdaptivePoolingAllocator.allocate(AdaptivePoolingAllocator.java:257) at io.netty.buffer.AdaptivePoolingAllocator.reallocate(AdaptivePoolingAllocator.java:319) at io.netty.buffer.AdaptivePoolingAllocator$AdaptiveByteBuf.capacity(AdaptivePoolingAllocator.java:1493) at io.netty.buffer.AbstractByteBuf.ensureWritable0(AbstractByteBuf.java:305) at io.netty.buffer.AbstractByteBuf.ensureWritable(AbstractByteBuf.java:280) at io.netty.handler.ssl.SslHandler.wrap(SslHandler.java:1170) at io.netty.handler.ssl.SslHandler.wrap(SslHandler.java:892) ```
1 parent 5563de0 commit b841f0b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/src/main/java/com/linecorp/armeria/common/CoreBlockHoundIntegration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,7 @@ public void applyTo(Builder builder) {
6969
"java.util.concurrent.FutureTask", "handlePossibleCancellationInterrupt");
7070
// SecureRandom.nextBytes() can be called
7171
builder.allowBlockingCallsInside("io.netty.handler.ssl.SslContext", "buildKeyStore");
72+
// StampedLock.writeLock() can be called
73+
builder.allowBlockingCallsInside("io.netty.buffer.AdaptivePoolingAllocator", "allocate");
7274
}
7375
}

0 commit comments

Comments
 (0)