You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Anders Wallgren (JIRA)" <ji...@apache.org> on 2007/01/28 22:44:49 UTC

[jira] Created: (HTTPCORE-35) SessionRequest lifecycle seems inconsistent with its usage

SessionRequest lifecycle seems inconsistent with its usage
----------------------------------------------------------

                 Key: HTTPCORE-35
                 URL: https://issues.apache.org/jira/browse/HTTPCORE-35
             Project: HttpComponents Core
          Issue Type: Bug
          Components: HttpCore NIO
    Affects Versions: 4.0-alpha3
            Reporter: Anders Wallgren


The lifecycle of SessionRequest seems inconsistent with its intended usage.

For example, it supports setting a connection timeout and a SessiongRequestCallback.

However, ConnectingIOReactor returns a SessionRequest object from the connect method.

Isn't there then a race condition between me setting the callback or connection timeouts?

-- 
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: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


[jira] Commented: (HTTPCORE-35) SessionRequest lifecycle seems inconsistent with its usage

Posted by "Anders Wallgren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-35?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12468400 ] 

Anders Wallgren commented on HTTPCORE-35:
-----------------------------------------

That's great -- I should have inspected the code more closely before filing the issue.

> SessionRequest lifecycle seems inconsistent with its usage
> ----------------------------------------------------------
>
>                 Key: HTTPCORE-35
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-35
>             Project: HttpComponents Core
>          Issue Type: Bug
>          Components: HttpCore NIO
>    Affects Versions: 4.0-alpha3
>            Reporter: Anders Wallgren
>
> The lifecycle of SessionRequest seems inconsistent with its intended usage.
> For example, it supports setting a connection timeout and a SessiongRequestCallback.
> However, ConnectingIOReactor returns a SessionRequest object from the connect method.
> Isn't there then a race condition between me setting the callback or connection timeouts?

-- 
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: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


[jira] Resolved: (HTTPCORE-35) SessionRequest lifecycle seems inconsistent with its usage

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

Oleg Kalnichevski resolved HTTPCORE-35.
---------------------------------------

    Resolution: Invalid

> Isn't there then a race condition between me setting the callback or connection timeouts? 

I do not think so. For instance, if the connection timeout is set after the connect request has already been completed, it will just have no effect, which seems reasonable. The access to SessionRequestCallback is synchronized. Even if the callback is set after completing of the connect request it will still fire an event depending on the outcome of the connect operation. I do not see a race condition here.    

    public void setCallback(final SessionRequestCallback callback) {
        synchronized (this) {
            this.callback = callback;
            if (this.completed) {
                if (this.exception != null) {
                    callback.failed(this);
                } else if (this.session != null) {
                    callback.completed(this);
                }
            }
        }
    }

Please feel free to re-open the issue if you think I am missing something

Oleg

> SessionRequest lifecycle seems inconsistent with its usage
> ----------------------------------------------------------
>
>                 Key: HTTPCORE-35
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-35
>             Project: HttpComponents Core
>          Issue Type: Bug
>          Components: HttpCore NIO
>    Affects Versions: 4.0-alpha3
>            Reporter: Anders Wallgren
>
> The lifecycle of SessionRequest seems inconsistent with its intended usage.
> For example, it supports setting a connection timeout and a SessiongRequestCallback.
> However, ConnectingIOReactor returns a SessionRequest object from the connect method.
> Isn't there then a race condition between me setting the callback or connection timeouts?

-- 
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: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org