-
Bug
-
Resolution: Done
-
Major
-
3.7.7.Final, 3.8.0.Final
The following NPE happens on XNIO ByteBufferSlicePool.clean() for non-direct buffers during the shutdown. For example, when direct-buffers="false" is specified to <buffer-pool> in the io subsystem.
10:02:08,180 WARN [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000004: Failure during stop of service org.wildfly.io.buffer-pool.default: java.lang.NullPointerException at java.util.concurrent.ConcurrentLinkedQueue.addAll(ConcurrentLinkedQueue.java:530) at org.xnio.ByteBufferSlicePool.clean(ByteBufferSlicePool.java:214) at org.wildfly.extension.io.BufferPoolService.stop(BufferPoolService.java:62) at org.jboss.msc.service.ServiceControllerImpl$StopTask.stopService(ServiceControllerImpl.java:1795) at org.jboss.msc.service.ServiceControllerImpl$StopTask.execute(ServiceControllerImpl.java:1764) at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559) at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378) at java.lang.Thread.run(Thread.java:748)
This issue happens since EAP 7.2.4 that incorporates JBEAP-17380 / (XNIO-345 / XNIO-346).
This NPE itself is harmless and ignorable as direct buffers is disabled. However, it's better to fix this by adding a null check for "directBuffers". For example:
diff --git a/api/src/main/java/org/xnio/ByteBufferSlicePool.java b/api/src/main/java/org/xnio/ByteBufferSlicePool.java index cae23c5..f30125e 100644 --- a/api/src/main/java/org/xnio/ByteBufferSlicePool.java +++ b/api/src/main/java/org/xnio/ByteBufferSlicePool.java @@ -206,8 +206,11 @@ public final class ByteBufferSlicePool implements Pool<ByteBuffer> { if(!sliceQueue.isEmpty()) { sliceQueue.clear(); } - // pass everything that is directly allocated to free direct buffers - FREE_DIRECT_BUFFERS.addAll(directBuffers); + // only true if using direct allocation + if (directBuffers != null) { + // pass everything that is directly allocated to free direct buffers + FREE_DIRECT_BUFFERS.addAll(directBuffers); + } } /**
- clones
-
JBEAP-19049 [GSS](7.2.z) XNIO-372 - NPE happens on XNIO ByteBufferSlicePool.clean() for non-direct buffers during the shutdown
- Closed
- is cloned by
-
JBEAP-19321 [GSS](7.3.z) XNIO-372 - NPE happens on ByteBufferSlicePool.clean() for non-direct buffers
- Closed
- is incorporated by
-
WFCORE-4944 Upgrade XNIO from 3.8.0 to ...
- Closed