You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Sangjin Lee (JIRA)" <ji...@apache.org> on 2008/03/13 19:26:24 UTC

[jira] Created: (GERONIMO-3917) response future does not complete if a connection is closed before the response is received

response future does not complete if a connection is closed before the response is received
-------------------------------------------------------------------------------------------

                 Key: GERONIMO-3917
                 URL: https://issues.apache.org/jira/browse/GERONIMO-3917
             Project: Geronimo
          Issue Type: Bug
      Security Level: public (Regular issues)
          Components: AsyncHttpClient
    Affects Versions: 1.x
            Reporter: Sangjin Lee
            Assignee: Rick McGuire


If for *any reason* the server closes a connection without sending the response, calls that wait on ResponseFuture.get() for the result will not return.

The key issue is the way HttpIoHandler.sessionClosed() works.  The sessionClosed() method is invoked when a session is closed.  Currently the only major things it does are to call callback's onClosed() method and remove the timeout alarm.  If the message was not received or an exception did not occur, however, the future remains not complete.  Therefore, any caller that waits on Future.get() will never get unblocked.

The sessionClosed() method needs to detect a situation where the connection is *prematurely* closed while the response has not been received and cause an exception and complete the future.

This is a pretty critical issue.



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


[jira] Updated: (GERONIMO-3917) response future does not complete if a connection is closed before the response is received

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

Sangjin Lee updated GERONIMO-3917:
----------------------------------

    Attachment: GERONIMO-3917.patch

I am attaching one suggested fix.  The gist of the idea is, we need to keep track of the fact that the request is "outstanding".  It means that it attempted to send the request, but has not received the response nor an exception occurred.  If the session is closing while the request is outstanding, then we trigger an exception so the future is completed and the onException() method on the callback fires if applicable.

Please take a look at what I did, and let me know if you have suggestions or comments...

> response future does not complete if a connection is closed before the response is received
> -------------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-3917
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-3917
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: AsyncHttpClient
>    Affects Versions: 1.x
>            Reporter: Sangjin Lee
>            Assignee: Rick McGuire
>         Attachments: GERONIMO-3917.patch
>
>
> If for *any reason* the server closes a connection without sending the response, calls that wait on ResponseFuture.get() for the result will not return.
> The key issue is the way HttpIoHandler.sessionClosed() works.  The sessionClosed() method is invoked when a session is closed.  Currently the only major things it does are to call callback's onClosed() method and remove the timeout alarm.  If the message was not received or an exception did not occur, however, the future remains not complete.  Therefore, any caller that waits on Future.get() will never get unblocked.
> The sessionClosed() method needs to detect a situation where the connection is *prematurely* closed while the response has not been received and cause an exception and complete the future.
> This is a pretty critical issue.

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


[jira] Closed: (GERONIMO-3917) response future does not complete if a connection is closed before the response is received

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

Sangjin Lee closed GERONIMO-3917.
---------------------------------


> response future does not complete if a connection is closed before the response is received
> -------------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-3917
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-3917
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: AsyncHttpClient
>    Affects Versions: 1.x
>            Reporter: Sangjin Lee
>            Assignee: Rick McGuire
>         Attachments: GERONIMO-3917.patch
>
>
> If for *any reason* the server closes a connection without sending the response, calls that wait on ResponseFuture.get() for the result will not return.
> The key issue is the way HttpIoHandler.sessionClosed() works.  The sessionClosed() method is invoked when a session is closed.  Currently the only major things it does are to call callback's onClosed() method and remove the timeout alarm.  If the message was not received or an exception did not occur, however, the future remains not complete.  Therefore, any caller that waits on Future.get() will never get unblocked.
> The sessionClosed() method needs to detect a situation where the connection is *prematurely* closed while the response has not been received and cause an exception and complete the future.
> This is a pretty critical issue.

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


[jira] Resolved: (GERONIMO-3917) response future does not complete if a connection is closed before the response is received

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

Rick McGuire resolved GERONIMO-3917.
------------------------------------

    Resolution: Fixed

Committed revision 639597.

> response future does not complete if a connection is closed before the response is received
> -------------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-3917
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-3917
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: AsyncHttpClient
>    Affects Versions: 1.x
>            Reporter: Sangjin Lee
>            Assignee: Rick McGuire
>         Attachments: GERONIMO-3917.patch
>
>
> If for *any reason* the server closes a connection without sending the response, calls that wait on ResponseFuture.get() for the result will not return.
> The key issue is the way HttpIoHandler.sessionClosed() works.  The sessionClosed() method is invoked when a session is closed.  Currently the only major things it does are to call callback's onClosed() method and remove the timeout alarm.  If the message was not received or an exception did not occur, however, the future remains not complete.  Therefore, any caller that waits on Future.get() will never get unblocked.
> The sessionClosed() method needs to detect a situation where the connection is *prematurely* closed while the response has not been received and cause an exception and complete the future.
> This is a pretty critical issue.

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