-
Bug
-
Resolution: Done
-
Major
-
7.2.7.GA
-
None
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-19321 [GSS](7.3.z) XNIO-372 - NPE happens on ByteBufferSlicePool.clean() for non-direct buffers
- Closed
- is cloned by
-
XNIO-372 NPE happens on ByteBufferSlicePool.clean() for non-direct buffers
- Resolved
- is incorporated by
-
JBEAP-19315 [GSS](7.2.z) Upgrade XNIO from 3.7.6.SP2 to 3.7.6.SP3
- Closed
- links to