You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "David Rosenstrauch (JIRA)" <ji...@apache.org> on 2009/02/13 06:08:00 UTC

[jira] Created: (DIRMINA-661) DummySession.close(true) not notifying close listener

DummySession.close(true) not notifying close listener
-----------------------------------------------------

                 Key: DIRMINA-661
                 URL: https://issues.apache.org/jira/browse/DIRMINA-661
             Project: MINA
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.0.0-M4
         Environment: All?
            Reporter: David Rosenstrauch
            Priority: Minor


I'm trying to add a close listener onto a session, and perform some processing after the session close is completed. 

This works fine on a live system (i.e., when using a NioSocketSession), but when I unit test using a DummySession I never get notified about operationComplete.


See example JUnit test case at:

http://www.darose.net/TestDummyIoSession.java

-----

Additional analysis, as per Emmanuel Lécharny :

I think that the listeners are never called in the awaitUninterruptibly() method :

   /**
    * {@inheritDoc}
    */
   public IoFuture awaitUninterruptibly() {
       try {
           await0(Long.MAX_VALUE, false);
       } catch ( InterruptedException ie) {
           // Do nothing : this catch is just mandatory by contract
       }
  ...

The doc is explicit here :
   /**
    * Wait for the asynchronous operation to complete uninterruptibly.
    * *The attached listeners will be notified when the operation is
    * completed.*
    *
    * @return the current IoFuture
    */
   IoFuture awaitUninterruptibly();

The listeners are never called... 


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DIRMINA-661) DummySession.close(true) not notifying close listener

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-661?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny resolved DIRMINA-661.
---------------------------------------

    Resolution: Fixed

The issue was due to a missing invocation of the fireSessionClosed() in the DummyIoSession IoProcessor implementation for the remove() method : when the session is removed, the event should be propagated otherwise the closeFuture listeners are never called.

Fixed in http://svn.apache.org/viewvc?rev=744025&view=rev


> DummySession.close(true) not notifying close listener
> -----------------------------------------------------
>
>                 Key: DIRMINA-661
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-661
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M4
>         Environment: All?
>            Reporter: David Rosenstrauch
>            Priority: Minor
>
> I'm trying to add a close listener onto a session, and perform some processing after the session close is completed. 
> This works fine on a live system (i.e., when using a NioSocketSession), but when I unit test using a DummySession I never get notified about operationComplete.
> See example JUnit test case at:
> http://www.darose.net/TestDummyIoSession.java
> -----
> Additional analysis, as per Emmanuel Lécharny :
> I think that the listeners are never called in the awaitUninterruptibly() method :
>    /**
>     * {@inheritDoc}
>     */
>    public IoFuture awaitUninterruptibly() {
>        try {
>            await0(Long.MAX_VALUE, false);
>        } catch ( InterruptedException ie) {
>            // Do nothing : this catch is just mandatory by contract
>        }
>   ...
> The doc is explicit here :
>    /**
>     * Wait for the asynchronous operation to complete uninterruptibly.
>     * *The attached listeners will be notified when the operation is
>     * completed.*
>     *
>     * @return the current IoFuture
>     */
>    IoFuture awaitUninterruptibly();
> The listeners are never called... 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DIRMINA-661) DummySession.close(true) not notifying close listener

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-661?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny updated DIRMINA-661:
--------------------------------------

    Fix Version/s: 2.0.0-M5

> DummySession.close(true) not notifying close listener
> -----------------------------------------------------
>
>                 Key: DIRMINA-661
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-661
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M4
>         Environment: All?
>            Reporter: David Rosenstrauch
>            Assignee: Emmanuel Lecharny
>            Priority: Minor
>             Fix For: 2.0.0-M5
>
>
> I'm trying to add a close listener onto a session, and perform some processing after the session close is completed. 
> This works fine on a live system (i.e., when using a NioSocketSession), but when I unit test using a DummySession I never get notified about operationComplete.
> See example JUnit test case at:
> http://www.darose.net/TestDummyIoSession.java
> -----
> Additional analysis, as per Emmanuel Lécharny :
> I think that the listeners are never called in the awaitUninterruptibly() method :
>    /**
>     * {@inheritDoc}
>     */
>    public IoFuture awaitUninterruptibly() {
>        try {
>            await0(Long.MAX_VALUE, false);
>        } catch ( InterruptedException ie) {
>            // Do nothing : this catch is just mandatory by contract
>        }
>   ...
> The doc is explicit here :
>    /**
>     * Wait for the asynchronous operation to complete uninterruptibly.
>     * *The attached listeners will be notified when the operation is
>     * completed.*
>     *
>     * @return the current IoFuture
>     */
>    IoFuture awaitUninterruptibly();
> The listeners are never called... 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (DIRMINA-661) DummySession.close(true) not notifying close listener

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-661?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny closed DIRMINA-661.
-------------------------------------


> DummySession.close(true) not notifying close listener
> -----------------------------------------------------
>
>                 Key: DIRMINA-661
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-661
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M4
>         Environment: All?
>            Reporter: David Rosenstrauch
>            Assignee: Emmanuel Lecharny
>            Priority: Minor
>             Fix For: 2.0.0-M5
>
>
> I'm trying to add a close listener onto a session, and perform some processing after the session close is completed. 
> This works fine on a live system (i.e., when using a NioSocketSession), but when I unit test using a DummySession I never get notified about operationComplete.
> See example JUnit test case at:
> http://www.darose.net/TestDummyIoSession.java
> -----
> Additional analysis, as per Emmanuel Lécharny :
> I think that the listeners are never called in the awaitUninterruptibly() method :
>    /**
>     * {@inheritDoc}
>     */
>    public IoFuture awaitUninterruptibly() {
>        try {
>            await0(Long.MAX_VALUE, false);
>        } catch ( InterruptedException ie) {
>            // Do nothing : this catch is just mandatory by contract
>        }
>   ...
> The doc is explicit here :
>    /**
>     * Wait for the asynchronous operation to complete uninterruptibly.
>     * *The attached listeners will be notified when the operation is
>     * completed.*
>     *
>     * @return the current IoFuture
>     */
>    IoFuture awaitUninterruptibly();
> The listeners are never called... 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (DIRMINA-661) DummySession.close(true) not notifying close listener

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-661?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny reassigned DIRMINA-661:
-----------------------------------------

    Assignee: Emmanuel Lecharny

> DummySession.close(true) not notifying close listener
> -----------------------------------------------------
>
>                 Key: DIRMINA-661
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-661
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M4
>         Environment: All?
>            Reporter: David Rosenstrauch
>            Assignee: Emmanuel Lecharny
>            Priority: Minor
>
> I'm trying to add a close listener onto a session, and perform some processing after the session close is completed. 
> This works fine on a live system (i.e., when using a NioSocketSession), but when I unit test using a DummySession I never get notified about operationComplete.
> See example JUnit test case at:
> http://www.darose.net/TestDummyIoSession.java
> -----
> Additional analysis, as per Emmanuel Lécharny :
> I think that the listeners are never called in the awaitUninterruptibly() method :
>    /**
>     * {@inheritDoc}
>     */
>    public IoFuture awaitUninterruptibly() {
>        try {
>            await0(Long.MAX_VALUE, false);
>        } catch ( InterruptedException ie) {
>            // Do nothing : this catch is just mandatory by contract
>        }
>   ...
> The doc is explicit here :
>    /**
>     * Wait for the asynchronous operation to complete uninterruptibly.
>     * *The attached listeners will be notified when the operation is
>     * completed.*
>     *
>     * @return the current IoFuture
>     */
>    IoFuture awaitUninterruptibly();
> The listeners are never called... 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.