mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carl Wicklow (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DIRMINA-1047) NullPointerException in AbstractIoSession.destroy()
Date Fri, 07 Oct 2016 09:26:20 GMT

    [ https://issues.apache.org/jira/browse/DIRMINA-1047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15554633#comment-15554633
] 

Carl Wicklow commented on DIRMINA-1047:
---------------------------------------

I can test it (I may not get that done today, but sometime soon).

> NullPointerException in AbstractIoSession.destroy()
> ---------------------------------------------------
>
>                 Key: DIRMINA-1047
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-1047
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.15
>         Environment: Any
>            Reporter: Carl Wicklow
>             Fix For: 2.0.16
>
>
> After upgrading to *v2.0.15*, we get this NPE ...
> {noformat}
> java.lang.NullPointerException
> 	at org.apache.mina.core.session.AbstractIoSession.destroy(AbstractIoSession.java:369)
> 	at org.apache.mina.core.session.AbstractIoSession.closeNow(AbstractIoSession.java:350)
> 	at org.apache.mina.core.session.DefaultIoSessionDataStructureFactory$DefaultWriteRequestQueue.poll(DefaultIoSessionDataStructureFactory.java:222)
> 	at org.apache.mina.core.polling.AbstractPollingIoProcessor.flushNow(AbstractPollingIoProcessor.java:827)
> 	at org.apache.mina.core.polling.AbstractPollingIoProcessor.flush(AbstractPollingIoProcessor.java:767)
> 	at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$700(AbstractPollingIoProcessor.java:68)
> 	at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1125)
> 	at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> 	at java.lang.Thread.run(Thread.java:745)
> {noformat}
> If I'm reading it right, the destroy also needs to allow that the writeRequest  returned
by the poll() of the WriteRequestQueue may return null if the queue is empty.
> In our case the destroy was invoked after polling a CLOSE_REQUEST caused by an earlier
closeOnFlush(), and the write request queue was empty.
> {code:title=AbstractIoSession.java|borderStyle=solid}
>     protected void destroy() {
>         if (writeRequestQueue != null) {
>             while (!writeRequestQueue.isEmpty(this)) {
>                 WriteRequest writeRequest = writeRequestQueue.poll(this);
>                 WriteFuture writeFuture = writeRequest.getFuture();
>                 
>                 // The WriteRequest may not always have a future : The CLOSE_REQUEST
>                 // and MESSAGE_SENT_REQUEST don't.
>                 if (writeFuture != null) {
>                     writeFuture.setWritten();
>                 }
>             }
>         }
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message