You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Jeff Mesnil (JIRA)" <ji...@apache.org> on 2008/04/14 14:01:06 UTC

[jira] Created: (DIRMINA-569) KeepAliveFilter's BOTH_IDLE is not working as expected

KeepAliveFilter's BOTH_IDLE is not working as expected
------------------------------------------------------

                 Key: DIRMINA-569
                 URL: https://issues.apache.org/jira/browse/DIRMINA-569
             Project: MINA
          Issue Type: Bug
          Components: Core
         Environment: MINA trunk (r647676)
            Reporter: Jeff Mesnil


for my code, I need to send keep-alive messages when the client IoSession is idle both in reading and writing.

Using IdleStatus.BOTH_IDLE does not work as  I expected it:
When the KeepAliveFilter is notified that it is BOTH_IDLE, it sends a keep-alive request.
However, sending this request means that the session is no longer WRITER_IDLE.
In turn, this means that the filter is notified that the session is READER_IDLE only.
Since it is waiting a response (from the BOTH_IDLE notification) that has not been received, it falsely handles it as a timeout.



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


[jira] Resolved: (DIRMINA-569) KeepAliveFilter's BOTH_IDLE is not working as expected

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

Trustin Lee resolved DIRMINA-569.
---------------------------------

    Resolution: Fixed
      Assignee: Trustin Lee

I've just checked in the fix.  Please confirm and close.

> KeepAliveFilter's BOTH_IDLE is not working as expected
> ------------------------------------------------------
>
>                 Key: DIRMINA-569
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-569
>             Project: MINA
>          Issue Type: Bug
>          Components: Filter
>         Environment: MINA trunk (r647676)
>            Reporter: Jeff Mesnil
>            Assignee: Trustin Lee
>         Attachments: DIRMINA-569.txt
>
>
> for my code, I need to send keep-alive messages when the client IoSession is idle both in reading and writing.
> Using IdleStatus.BOTH_IDLE does not work as  I expected it:
> When the KeepAliveFilter is notified that it is BOTH_IDLE, it sends a keep-alive request.
> However, sending this request means that the session is no longer WRITER_IDLE.
> In turn, this means that the filter is notified that the session is READER_IDLE only.
> Since it is waiting a response (from the BOTH_IDLE notification) that has not been received, it falsely handles it as a timeout.

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


[jira] Closed: (DIRMINA-569) KeepAliveFilter's BOTH_IDLE is not working as expected

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

Jeff Mesnil closed DIRMINA-569.
-------------------------------


I confirm the issue is fixed.

thanks

> KeepAliveFilter's BOTH_IDLE is not working as expected
> ------------------------------------------------------
>
>                 Key: DIRMINA-569
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-569
>             Project: MINA
>          Issue Type: Bug
>          Components: Filter
>         Environment: MINA trunk (r647676)
>            Reporter: Jeff Mesnil
>            Assignee: Trustin Lee
>         Attachments: DIRMINA-569.txt
>
>
> for my code, I need to send keep-alive messages when the client IoSession is idle both in reading and writing.
> Using IdleStatus.BOTH_IDLE does not work as  I expected it:
> When the KeepAliveFilter is notified that it is BOTH_IDLE, it sends a keep-alive request.
> However, sending this request means that the session is no longer WRITER_IDLE.
> In turn, this means that the filter is notified that the session is READER_IDLE only.
> Since it is waiting a response (from the BOTH_IDLE notification) that has not been received, it falsely handles it as a timeout.

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


[jira] Updated: (DIRMINA-569) KeepAliveFilter's BOTH_IDLE is not working as expected

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

Jeff Mesnil updated DIRMINA-569:
--------------------------------

    Attachment: DIRMINA-569.txt

This patch contains test cases to highlight this issue.

Once the connector is connected, we wait a little so that the session starts to be idle.
After a little time, we check we've not been notified of an exception.

The same code is used with only changing the value of IdleStatus.
The tests pass for READER_IDLE & WRITER_IDLE and fails for BOTH_IDLE



> KeepAliveFilter's BOTH_IDLE is not working as expected
> ------------------------------------------------------
>
>                 Key: DIRMINA-569
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-569
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>         Environment: MINA trunk (r647676)
>            Reporter: Jeff Mesnil
>         Attachments: DIRMINA-569.txt
>
>
> for my code, I need to send keep-alive messages when the client IoSession is idle both in reading and writing.
> Using IdleStatus.BOTH_IDLE does not work as  I expected it:
> When the KeepAliveFilter is notified that it is BOTH_IDLE, it sends a keep-alive request.
> However, sending this request means that the session is no longer WRITER_IDLE.
> In turn, this means that the filter is notified that the session is READER_IDLE only.
> Since it is waiting a response (from the BOTH_IDLE notification) that has not been received, it falsely handles it as a timeout.

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


[jira] Commented: (DIRMINA-569) KeepAliveFilter's BOTH_IDLE is not working as expected

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12588571#action_12588571 ] 

Trustin Lee commented on DIRMINA-569:
-------------------------------------

It seems like BOTH_IDLE doesn't trigger WRITER_IDLE because KeepAliveFilter clears WRITER_IDLE status as you described.

> KeepAliveFilter's BOTH_IDLE is not working as expected
> ------------------------------------------------------
>
>                 Key: DIRMINA-569
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-569
>             Project: MINA
>          Issue Type: Bug
>          Components: Filter
>         Environment: MINA trunk (r647676)
>            Reporter: Jeff Mesnil
>         Attachments: DIRMINA-569.txt
>
>
> for my code, I need to send keep-alive messages when the client IoSession is idle both in reading and writing.
> Using IdleStatus.BOTH_IDLE does not work as  I expected it:
> When the KeepAliveFilter is notified that it is BOTH_IDLE, it sends a keep-alive request.
> However, sending this request means that the session is no longer WRITER_IDLE.
> In turn, this means that the filter is notified that the session is READER_IDLE only.
> Since it is waiting a response (from the BOTH_IDLE notification) that has not been received, it falsely handles it as a timeout.

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


[jira] Commented: (DIRMINA-569) KeepAliveFilter's BOTH_IDLE is not working as expected

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12588569#action_12588569 ] 

Trustin Lee commented on DIRMINA-569:
-------------------------------------

Thanks for the test case Jeff!  It is very helpful.

BTW, the description of the problem is not correct.  The problem is that READER_IDLE and WRITER_IDLE is always fired together with BOTH_IDLE.  Therefore, whenever BOTH_IDLE is fired, READER_IDLE is fired immediately, causing an exception.  KeepAliveFilter should be modified to ignore the READER_IDLE state when interestedIdleStatus is BOTH_IDLE and the current state is BOTH_IDLE.

> KeepAliveFilter's BOTH_IDLE is not working as expected
> ------------------------------------------------------
>
>                 Key: DIRMINA-569
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-569
>             Project: MINA
>          Issue Type: Bug
>          Components: Filter
>         Environment: MINA trunk (r647676)
>            Reporter: Jeff Mesnil
>         Attachments: DIRMINA-569.txt
>
>
> for my code, I need to send keep-alive messages when the client IoSession is idle both in reading and writing.
> Using IdleStatus.BOTH_IDLE does not work as  I expected it:
> When the KeepAliveFilter is notified that it is BOTH_IDLE, it sends a keep-alive request.
> However, sending this request means that the session is no longer WRITER_IDLE.
> In turn, this means that the filter is notified that the session is READER_IDLE only.
> Since it is waiting a response (from the BOTH_IDLE notification) that has not been received, it falsely handles it as a timeout.

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


[jira] Updated: (DIRMINA-569) KeepAliveFilter's BOTH_IDLE is not working as expected

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

Trustin Lee updated DIRMINA-569:
--------------------------------

    Component/s:     (was: Core)
                 Filter

> KeepAliveFilter's BOTH_IDLE is not working as expected
> ------------------------------------------------------
>
>                 Key: DIRMINA-569
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-569
>             Project: MINA
>          Issue Type: Bug
>          Components: Filter
>         Environment: MINA trunk (r647676)
>            Reporter: Jeff Mesnil
>         Attachments: DIRMINA-569.txt
>
>
> for my code, I need to send keep-alive messages when the client IoSession is idle both in reading and writing.
> Using IdleStatus.BOTH_IDLE does not work as  I expected it:
> When the KeepAliveFilter is notified that it is BOTH_IDLE, it sends a keep-alive request.
> However, sending this request means that the session is no longer WRITER_IDLE.
> In turn, this means that the filter is notified that the session is READER_IDLE only.
> Since it is waiting a response (from the BOTH_IDLE notification) that has not been received, it falsely handles it as a timeout.

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