Uploaded image for project: 'MINA'
  1. MINA
  2. DIRMINA-567

NPE in AbstractIoSession after getWaitingReadFutures

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0-M1
    • 2.0.0-M2
    • Core
    • None

    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)

      Attachments

        1. patch.diff
          0.9 kB
          Dennis Sieben

        Activity

          d7 Dennis Sieben added a comment -

          A patch which seems to fix this issue for me. Hopefully it is fixed at the right point.

          d7 Dennis Sieben added a comment - A patch which seems to fix this issue for me. Hopefully it is fixed at the right point.
          d7 Dennis Sieben added a comment -

          One further question: I'm planning to use M2 with this patch applied in a productive environment. The tests I made so far, don't show up any further bugs in my szenario (simple client-server connection). What is your opinion about using this early state in a productive environment?

          d7 Dennis Sieben added a comment - One further question: I'm planning to use M2 with this patch applied in a productive environment. The tests I made so far, don't show up any further bugs in my szenario (simple client-server connection). What is your opinion about using this early state in a productive environment?
          trustin Trustin Lee added a comment -

          Thanks for the patch! I've just checked in the fix slightly modified from yours.

          trustin Trustin Lee added a comment - Thanks for the patch! I've just checked in the fix slightly modified from yours.
          trustin Trustin Lee added a comment -

          It's entirely up to you to use 3.0.0-M2-SNAPSHOT in your production environment. I also couldn't find any critical bug yet. However, we will have some changes in API until we reach the RC. If you can catch up the changes, you might want to give it a try.

          trustin Trustin Lee added a comment - It's entirely up to you to use 3.0.0-M2-SNAPSHOT in your production environment. I also couldn't find any critical bug yet. However, we will have some changes in API until we reach the RC. If you can catch up the changes, you might want to give it a try.

          People

            trustin Trustin Lee
            d7 Dennis Sieben
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: