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

Exception in thread "SocketAcceptor-1" java.nio.channels.CancelledKeyException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.8.3, 1.0.0
    • 0.8.4, 1.0.1
    • Core
    • None
    • Unix (Asianux) with Service Wrapper

    Description

      Environment: Unix (Asianux) with Service Wrapper.
      My software (called DC) works a server listening on some Port, it will receive messages from several of BC.
      Each BC will get and keep the connection then sending the messages through this session (if disconnect, BC will re-connect and continue sending the messages).

      My problem is:
      When executing long-run testing: has 5 BC sending messages to DC.
      I tried to stop the DC via: ./dc-deamon.sh stop (this script is got from Service Wrapper site).
      => the kind of exception below had occurred:
      -------------------------------------------------------------------------------------------
      main | 2006/10/02 09:12:23 | 2006-10-02 09:12:23:170 [SocketAcceptor-1] [com.yokogawa.toshibaks.dc.protocol.DataMessageSessionHandler:98] INFO [][][] - [/172.16.10.199:13301] CREATED: Accept connection on DataPort: 9870
      main | 2006/10/02 09:12:23 | 2006-10-02 09:12:23:235 [ProtocolThreadPool-5] [com.yokogawa.toshibaks.dc.protocol.DataMessageSessionHandler:98] INFO [][][] - [/172.16.10.199:13301] OPENED
      main | 2006/10/02 09:12:23 | 2006-10-02 09:12:23:236 [ProtocolThreadPool-21] [com.yokogawa.toshibaks.dc.protocol.DataMessageSessionHandler:98] INFO [][][] - [/172.16.10.199:13301] CLOSED: Connection on DataPort [9870] has been closed.
      main | 2006/10/02 09:12:24 | 2006-10-02 09:12:24:237 [SocketAcceptor-1] [com.yokogawa.toshibaks.dc.protocol.DataMessageSessionHandler:98] INFO [][][] - [/172.16.10.142:46806] CREATED: Accept connection on DataPort: 9874
      main | 2006/10/02 09:12:24 | 2006-10-02 09:12:24:237 [ProtocolThreadPool-5] [com.yokogawa.toshibaks.dc.protocol.DataMessageSessionHandler:98] INFO [][][] - [/172.16.10.142:46806] OPENED
      main | 2006/10/02 09:18:04 | TERM trapped. Shutting down.
      main | 2006/10/02 09:18:04 | Stoping the DC...
      main | 2006/10/02 09:18:04 | 2006-10-02 09:18:04:284 [Wrapper-Connection] [com.yokogawa.toshibaks:99] INFO [][][] - DC is stopping.
      main | 2006/10/02 09:18:04 | 2006-10-02 09:18:04:305 [Wrapper-Connection] [com.yokogawa.toshibaks:285] INFO [][][] - Stop listening on all Data ports and close all data sessions...
      main | 2006/10/02 09:18:05 | Exception in thread "SocketAcceptor-1" java.nio.channels.CancelledKeyException
      main | 2006/10/02 09:18:05 | at sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionKeyImpl.java:55)
      main | 2006/10/02 09:18:05 | at sun.nio.ch.SelectionKeyImpl.readyOps(SelectionKeyImpl.java:69)
      main | 2006/10/02 09:18:05 | at java.nio.channels.SelectionKey.isAcceptable(SelectionKey.java:342)
      main | 2006/10/02 09:18:05 | at org.apache.mina.io.socket.SocketAcceptor$Worker.processSessions(SocketAcceptor.java:297)
      main | 2006/10/02 09:18:05 | at org.apache.mina.io.socket.SocketAcceptor$Worker.run(SocketAcceptor.java:244)
      main | 2006/10/02 09:22:24 | 2006-10-02 09:22:24:858 [ProtocolThreadPool-21] [com.yokogawa.toshibaks.dc.protocol.DataMessageSessionHandler:98] INFO [][][] - [/172.16.10.142:46806] IDLE: both idle
      main | 2006/10/02 09:22:24 | 2006-10-02 09:22:24:904 [ProtocolThreadPool-21] [com.yokogawa.toshibaks.dc.protocol.DataMessageSessionHandler:313] INFO [][][] - Idle timeout occurred. K/S is disconnecting...
      main | 2006/10/02 09:32:25 | 2006-10-02 09:32:25:428 [ProtocolThreadPool-4] [com.yokogawa.toshibaks.dc.protocol.DataMessageSessionHandler:98] INFO [][][] - [/172.16.10.142:46806] IDLE: both idle
      main | 2006/10/02 09:32:25 | 2006-10-02 09:32:25:429 [ProtocolThreadPool-4] [com.yokogawa.toshibaks.dc.protocol.DataMessageSessionHandler:313] INFO [][][] - Idle timeout occurred. K/S is disconnecting...
      main | 2006/10/02 09:42:26 | 2006-10-02 09:42:26:029 [ProtocolThreadPool-15] [com.yokogawa.toshibaks.dc.protocol.DataMessageSessionHandler:98] INFO [][][] - [/172.16.10.142:46806] IDLE: both idle
      main | 2006/10/02 09:42:26 | 2006-10-02 09:42:26:029 [ProtocolThreadPool-15] [com.yokogawa.toshibaks.dc.protocol.DataMessageSessionHandler:313] INFO [][][] - Idle timeout occurred. K/S is disconnecting...
      -------------------------------------------------------------------------------------------
      => the next action: my software could not stop.
      This issue happened sometimes (i reached 3 times).

      My software is going to live soon, so that if this issue happen in real-production line => VERY BIG PROBLEM.

      If you have any idea about this, please advice me.

      Attachments

        1. log.log
          3 kB
          Phan Thanh Hieu
        2. mina.zip
          6 kB
          Phan Thanh Hieu

        Activity

          People

            trustin Trustin Lee
            hieupt Phan Thanh Hieu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: