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 M. Lloyd (JIRA)" <ji...@apache.org> on 2008/02/20 22:45:43 UTC

[jira] Created: (DIRMINA-535) Session creation/opened callbacks are not called at logical times

Session creation/opened callbacks are not called at logical times
-----------------------------------------------------------------

                 Key: DIRMINA-535
                 URL: https://issues.apache.org/jira/browse/DIRMINA-535
             Project: MINA
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.0.0-M1
            Reporter: David M. Lloyd


The IoHandler.sessionCreated and IoHandler.sessionOpened methods are not called at useful times.  The sessionCreated method should be called *after* the session is constructed but before anything else is done.  The sessionOpened method should be called immediately after the connection is established, but *before* any messages are received (in other words, before the selectionkey is added to the selector).

>From the look of the code in AbstractPollingIoProcessor, it looks like sessionOpened is simply called immediately after sessionCreated (see IoServiceListenerSupport.fireSessionCreated()), rendering the separate methods useless.  In addition, it seems that there is nothing preventing a message from coming in before this initialization is complete, unless I am misunderstanding what threads are operating on these constructs.

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


[jira] Resolved: (DIRMINA-535) Session creation/opened callbacks are not called at logical times

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

Trustin Lee resolved DIRMINA-535.
---------------------------------

    Resolution: Invalid
      Assignee: Trustin Lee

This issue was actually Q&A.

> Session creation/opened callbacks are not called at logical times
> -----------------------------------------------------------------
>
>                 Key: DIRMINA-535
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-535
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M1
>            Reporter: David M. Lloyd
>            Assignee: Trustin Lee
>             Fix For: 2.0.0-M2
>
>
> The IoHandler.sessionCreated and IoHandler.sessionOpened methods are not called at useful times.  The sessionCreated method should be called *after* the session is constructed but before anything else is done.  The sessionOpened method should be called immediately after the connection is established, but *before* any messages are received (in other words, before the selectionkey is added to the selector).
> From the look of the code in AbstractPollingIoProcessor, it looks like sessionOpened is simply called immediately after sessionCreated (see IoServiceListenerSupport.fireSessionCreated()), rendering the separate methods useless.  In addition, it seems that there is nothing preventing a message from coming in before this initialization is complete, unless I am misunderstanding what threads are operating on these constructs.

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


[jira] Updated: (DIRMINA-535) Session creation/opened callbacks are not called at logical times

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

Mike Heath updated DIRMINA-535:
-------------------------------

    Fix Version/s: 2.0.0-M2

> Session creation/opened callbacks are not called at logical times
> -----------------------------------------------------------------
>
>                 Key: DIRMINA-535
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-535
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M1
>            Reporter: David M. Lloyd
>             Fix For: 2.0.0-M2
>
>
> The IoHandler.sessionCreated and IoHandler.sessionOpened methods are not called at useful times.  The sessionCreated method should be called *after* the session is constructed but before anything else is done.  The sessionOpened method should be called immediately after the connection is established, but *before* any messages are received (in other words, before the selectionkey is added to the selector).
> From the look of the code in AbstractPollingIoProcessor, it looks like sessionOpened is simply called immediately after sessionCreated (see IoServiceListenerSupport.fireSessionCreated()), rendering the separate methods useless.  In addition, it seems that there is nothing preventing a message from coming in before this initialization is complete, unless I am misunderstanding what threads are operating on these constructs.

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


[jira] Closed: (DIRMINA-535) Session creation/opened callbacks are not called at logical times

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

Julien Vermillard closed DIRMINA-535.
-------------------------------------


> Session creation/opened callbacks are not called at logical times
> -----------------------------------------------------------------
>
>                 Key: DIRMINA-535
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-535
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M1
>            Reporter: David M. Lloyd
>            Assignee: Trustin Lee
>             Fix For: 2.0.0-M2
>
>
> The IoHandler.sessionCreated and IoHandler.sessionOpened methods are not called at useful times.  The sessionCreated method should be called *after* the session is constructed but before anything else is done.  The sessionOpened method should be called immediately after the connection is established, but *before* any messages are received (in other words, before the selectionkey is added to the selector).
> From the look of the code in AbstractPollingIoProcessor, it looks like sessionOpened is simply called immediately after sessionCreated (see IoServiceListenerSupport.fireSessionCreated()), rendering the separate methods useless.  In addition, it seems that there is nothing preventing a message from coming in before this initialization is complete, unless I am misunderstanding what threads are operating on these constructs.

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


[jira] Commented: (DIRMINA-535) Session creation/opened callbacks are not called at logical times

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

Trustin Lee commented on DIRMINA-535:
-------------------------------------

Yes.  The only difference is the thread that the event is processed.

> Session creation/opened callbacks are not called at logical times
> -----------------------------------------------------------------
>
>                 Key: DIRMINA-535
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-535
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M1
>            Reporter: David M. Lloyd
>             Fix For: 2.0.0-M2
>
>
> The IoHandler.sessionCreated and IoHandler.sessionOpened methods are not called at useful times.  The sessionCreated method should be called *after* the session is constructed but before anything else is done.  The sessionOpened method should be called immediately after the connection is established, but *before* any messages are received (in other words, before the selectionkey is added to the selector).
> From the look of the code in AbstractPollingIoProcessor, it looks like sessionOpened is simply called immediately after sessionCreated (see IoServiceListenerSupport.fireSessionCreated()), rendering the separate methods useless.  In addition, it seems that there is nothing preventing a message from coming in before this initialization is complete, unless I am misunderstanding what threads are operating on these constructs.

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


[jira] Commented: (DIRMINA-535) Session creation/opened callbacks are not called at logical times

Posted by "David M. Lloyd (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12570841#action_12570841 ] 

David M. Lloyd commented on DIRMINA-535:
----------------------------------------

See this mailing list thread: http://www.nabble.com/Sending-a-message-directly-upon-connect-td15597268s16868.html

> Session creation/opened callbacks are not called at logical times
> -----------------------------------------------------------------
>
>                 Key: DIRMINA-535
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-535
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M1
>            Reporter: David M. Lloyd
>
> The IoHandler.sessionCreated and IoHandler.sessionOpened methods are not called at useful times.  The sessionCreated method should be called *after* the session is constructed but before anything else is done.  The sessionOpened method should be called immediately after the connection is established, but *before* any messages are received (in other words, before the selectionkey is added to the selector).
> From the look of the code in AbstractPollingIoProcessor, it looks like sessionOpened is simply called immediately after sessionCreated (see IoServiceListenerSupport.fireSessionCreated()), rendering the separate methods useless.  In addition, it seems that there is nothing preventing a message from coming in before this initialization is complete, unless I am misunderstanding what threads are operating on these constructs.

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


[jira] Commented: (DIRMINA-535) Session creation/opened callbacks are not called at logical times

Posted by "David M. Lloyd (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577842#action_12577842 ] 

David M. Lloyd commented on DIRMINA-535:
----------------------------------------

So is the connection guaranteed to be established at the time either sessionCreated or sessionOpened is called?

> Session creation/opened callbacks are not called at logical times
> -----------------------------------------------------------------
>
>                 Key: DIRMINA-535
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-535
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M1
>            Reporter: David M. Lloyd
>             Fix For: 2.0.0-M2
>
>
> The IoHandler.sessionCreated and IoHandler.sessionOpened methods are not called at useful times.  The sessionCreated method should be called *after* the session is constructed but before anything else is done.  The sessionOpened method should be called immediately after the connection is established, but *before* any messages are received (in other words, before the selectionkey is added to the selector).
> From the look of the code in AbstractPollingIoProcessor, it looks like sessionOpened is simply called immediately after sessionCreated (see IoServiceListenerSupport.fireSessionCreated()), rendering the separate methods useless.  In addition, it seems that there is nothing preventing a message from coming in before this initialization is complete, unless I am misunderstanding what threads are operating on these constructs.

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


[jira] Commented: (DIRMINA-535) Session creation/opened callbacks are not called at logical times

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

Trustin Lee commented on DIRMINA-535:
-------------------------------------

The difference between sessionCreated and sessionOpened is in how ExecutorFilter handles them.

ExecutorFilter never forwards sessionCreated event to an Executor.  By doing so, it is guaranteed that sessionCreated is always called before any other read / write operation.

On the other hand, ExecutorFilter forwards sessionOpened event to an Executor, and therefore any I/O can occur while you process sessionOpened event.

Of course, the difference disappears if you didn't add any ExecutorFilter or you inserted any IoFilter implementation that violates this contract.

If you used OrderedThreadPoolExecutor, sessionOpened will always be called before any messageReceived and messageSent events.

I'm not sure my explanation is clear.  Could you let me know if you are fine with the current distinction or you think we need some change in how sessionCreated and sessionOpened events are handled?

> Session creation/opened callbacks are not called at logical times
> -----------------------------------------------------------------
>
>                 Key: DIRMINA-535
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-535
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M1
>            Reporter: David M. Lloyd
>             Fix For: 2.0.0-M2
>
>
> The IoHandler.sessionCreated and IoHandler.sessionOpened methods are not called at useful times.  The sessionCreated method should be called *after* the session is constructed but before anything else is done.  The sessionOpened method should be called immediately after the connection is established, but *before* any messages are received (in other words, before the selectionkey is added to the selector).
> From the look of the code in AbstractPollingIoProcessor, it looks like sessionOpened is simply called immediately after sessionCreated (see IoServiceListenerSupport.fireSessionCreated()), rendering the separate methods useless.  In addition, it seems that there is nothing preventing a message from coming in before this initialization is complete, unless I am misunderstanding what threads are operating on these constructs.

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