Description
There seems to be a race condition in AbstractIoSession. The following NPE appears sometimes:
java.lang.NullPointerException
at org.apache.mina.common.AbstractIoSession.newReadFuture(AbstractIoSession.java:227)
at org.apache.mina.common.AbstractIoSession.offerFailedReadFuture(AbstractIoSession.java:212)
at org.apache.mina.common.DefaultIoFilterChain$TailFilter.exceptionCaught(DefaultIoFilterChain.java:727)
at org.apache.mina.common.DefaultIoFilterChain.callNextExceptionCaught(DefaultIoFilterChain.java:446)
at org.apache.mina.common.DefaultIoFilterChain.access$1100(DefaultIoFilterChain.java:40)
at org.apache.mina.common.DefaultIoFilterChain$EntryImpl$1.exceptionCaught(DefaultIoFilterChain.java:818)
at org.apache.mina.common.DefaultIoFilterChain$HeadFilter.exceptionCaught(DefaultIoFilterChain.java:601)
at org.apache.mina.common.DefaultIoFilterChain.callNextExceptionCaught(DefaultIoFilterChain.java:446)
at org.apache.mina.common.DefaultIoFilterChain.fireExceptionCaught(DefaultIoFilterChain.java:437)
at org.apache.mina.common.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:408)
at org.apache.mina.common.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:40)
at org.apache.mina.common.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:823)
at org.apache.mina.common.DefaultIoFilterChain$HeadFilter.messageReceived(DefaultIoFilterChain.java:607)
at org.apache.mina.common.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:405)
at org.apache.mina.common.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:399)
at org.apache.mina.common.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:425)
at org.apache.mina.common.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:387)
at org.apache.mina.common.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:379)
at org.apache.mina.common.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:43)
at org.apache.mina.common.AbstractPollingIoProcessor$Worker.run(AbstractPollingIoProcessor.java:678)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
A patch which seems to fix this issue for me. Hopefully it is fixed at the right point.