You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Asankha C. Perera (JIRA)" <ji...@apache.org> on 2009/09/28 07:01:16 UTC

[jira] Created: (HTTPCORE-208) Pass the IOSession along with the Exception to the registered IOReactorExceptionHandler

Pass the IOSession along with the Exception to the registered IOReactorExceptionHandler
---------------------------------------------------------------------------------------

                 Key: HTTPCORE-208
                 URL: https://issues.apache.org/jira/browse/HTTPCORE-208
             Project: HttpComponents HttpCore
          Issue Type: Improvement
    Affects Versions: 4.1-alpha1
            Reporter: Asankha C. Perera
            Assignee: Asankha C. Perera
            Priority: Minor
             Fix For: 4.1-beta1


Currently an IOReactorExceptionHandler is only passed the exception encountered by the reactor. The BaseIOReactor which ultimately calls the exception handler could pass the IOSession to the exception handler. With this, the exception handlers down the line could be enhanced to close the session/connection (if its not closed) or use the information for reporting purposes etc, such as connection details for the failure.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCORE-208) Pass the IOSession along with the Exception to the registered IOReactorExceptionHandler

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12760233#action_12760233 ] 

Oleg Kalnichevski commented on HTTPCORE-208:
--------------------------------------------

> For (1) and (2) type errors, I think its always better to stop and restart the IO reactor. 

Agreed.

> than writing a bunch of try-catches in multiple places of user code

(1) What I am trying to say is that I do not think IOReactorExceptionHandler is the right place. IOReactorExceptionHandler should be used in extreme cases for handling fatal exceptions. It should really be the last resort. If you want the protocol layer to be able to handle certain type of exceptions, just catch it in the IOEventDispatch impl where appropriate and let the protocol code handle using a callback of some kind while having full access to the IOSession that caused the exception.

(2) Another problem is that we ought not change IOReactorExceptionHandler interface unless we want the next release to be 5.0

Oleg

> Pass the IOSession along with the Exception to the registered IOReactorExceptionHandler
> ---------------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-208
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-208
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>    Affects Versions: 4.1-alpha1
>            Reporter: Asankha C. Perera
>            Assignee: Asankha C. Perera
>            Priority: Minor
>             Fix For: 4.1-beta1
>
>
> Currently an IOReactorExceptionHandler is only passed the exception encountered by the reactor. The BaseIOReactor which ultimately calls the exception handler could pass the IOSession to the exception handler. With this, the exception handlers down the line could be enhanced to close the session/connection (if its not closed) or use the information for reporting purposes etc, such as connection details for the failure.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCORE-208) Pass the IOSession along with the Exception to the registered IOReactorExceptionHandler

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12760235#action_12760235 ] 

Oleg Kalnichevski commented on HTTPCORE-208:
--------------------------------------------

Another possibility would be adding a new method to the NHttpServiceHandler / NHttpClientHandler interfaces, but, again, the problem is it cannot be done without breaking API 

Oleg

> Pass the IOSession along with the Exception to the registered IOReactorExceptionHandler
> ---------------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-208
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-208
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>    Affects Versions: 4.1-alpha1
>            Reporter: Asankha C. Perera
>            Assignee: Asankha C. Perera
>            Priority: Minor
>             Fix For: 4.1-beta1
>
>
> Currently an IOReactorExceptionHandler is only passed the exception encountered by the reactor. The BaseIOReactor which ultimately calls the exception handler could pass the IOSession to the exception handler. With this, the exception handlers down the line could be enhanced to close the session/connection (if its not closed) or use the information for reporting purposes etc, such as connection details for the failure.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Resolved: (HTTPCORE-208) Pass the IOSession along with the Exception to the registered IOReactorExceptionHandler

Posted by "Asankha C. Perera (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Asankha C. Perera resolved HTTPCORE-208.
----------------------------------------

    Resolution: Invalid

Hi Oleg

I have to agree that an API change will not be worth, considering the available options for user code. Will change Synapse code accordingly to handle any unexpected type (3) errors internally

thanks
asankha

> Pass the IOSession along with the Exception to the registered IOReactorExceptionHandler
> ---------------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-208
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-208
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>    Affects Versions: 4.1-alpha1
>            Reporter: Asankha C. Perera
>            Assignee: Asankha C. Perera
>            Priority: Minor
>             Fix For: 4.1-beta1
>
>
> Currently an IOReactorExceptionHandler is only passed the exception encountered by the reactor. The BaseIOReactor which ultimately calls the exception handler could pass the IOSession to the exception handler. With this, the exception handlers down the line could be enhanced to close the session/connection (if its not closed) or use the information for reporting purposes etc, such as connection details for the failure.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCORE-208) Pass the IOSession along with the Exception to the registered IOReactorExceptionHandler

Posted by "Asankha C. Perera (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12760220#action_12760220 ] 

Asankha C. Perera commented on HTTPCORE-208:
--------------------------------------------

Hi Oleg

For (1) and (2) type errors, I think its always better to stop and restart the IO reactor. 

For type (3) errors, I think its always better to close the session, and if the exception handler is intended to handle these anyway, I thought it would be a nice way to allow the user to handle them with the exception handler, than writing a bunch of try-catches in multiple places of user code, as a try-catch already exits just above that which would call into the exception handler anyway.

thanks
asankha

> Pass the IOSession along with the Exception to the registered IOReactorExceptionHandler
> ---------------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-208
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-208
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>    Affects Versions: 4.1-alpha1
>            Reporter: Asankha C. Perera
>            Assignee: Asankha C. Perera
>            Priority: Minor
>             Fix For: 4.1-beta1
>
>
> Currently an IOReactorExceptionHandler is only passed the exception encountered by the reactor. The BaseIOReactor which ultimately calls the exception handler could pass the IOSession to the exception handler. With this, the exception handlers down the line could be enhanced to close the session/connection (if its not closed) or use the information for reporting purposes etc, such as connection details for the failure.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[jira] Commented: (HTTPCORE-208) Pass the IOSession along with the Exception to the registered IOReactorExceptionHandler

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12760204#action_12760204 ] 

Oleg Kalnichevski commented on HTTPCORE-208:
--------------------------------------------

Hi Asankha

Conceptually, IOReactorExceptionHandler should not be receiving exceptions that are I/O session related. Events related to a particular I/O session are meant to be handled by the IOEventDispatch. 

IOReactorExceptionHandler is intended for handling of 
(1) I/O errors caused by a problem with the I/O reactor itself rather than an individual I/O session (such as a failure to open a listener)
(2) Runtime exceptions caused by a bug in the I/O reactor implementation
(3) Runtime exceptions not handled by IOEventDispatch

If you want to handle a runtime exception caused by a particular I/O session, you just have to make sure it is caught on the IOEventDispatch level, where you always have access to the underlying I/O session.

Does this make any sense?

Oleg

> Pass the IOSession along with the Exception to the registered IOReactorExceptionHandler
> ---------------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-208
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-208
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>    Affects Versions: 4.1-alpha1
>            Reporter: Asankha C. Perera
>            Assignee: Asankha C. Perera
>            Priority: Minor
>             Fix For: 4.1-beta1
>
>
> Currently an IOReactorExceptionHandler is only passed the exception encountered by the reactor. The BaseIOReactor which ultimately calls the exception handler could pass the IOSession to the exception handler. With this, the exception handlers down the line could be enhanced to close the session/connection (if its not closed) or use the information for reporting purposes etc, such as connection details for the failure.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org