[GitHub] ant-ivy pull request #54: IVY-735 Support timeouts on resolvers

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] ant-ivy pull request #54: IVY-735 Support timeouts on resolvers

apupier
GitHub user jaikiran opened a pull request:

    https://github.com/apache/ant-ivy/pull/54

    IVY-735 Support timeouts on resolvers

    The commit in this PR adds support for specifying connection and read timeouts for resolvers, so that users have control over how the resolvers behave when it comes to slow/unresponsive repositories. This feature has been requested in https://issues.apache.org/jira/browse/IVY-735
   
    This commit introduces the concept of "timeout-constraints" within a Ivy settings file. There can be any number of named timeout constraints, each with (optional) values for connection and read timeouts. These named timeout constraints can then be referred to by the individual resolvers via the `timeoutConstraint` attribute on them. Standard resolvers all have been updated to support this new attribute.
   
    An example usage looks something like this:
   
    ```
    <ivysettings>
        <timeout-constraints>
            <timeout-constraint name="test-timeout-1" connectionTimeout="100" readTimeout="500"/>
            <timeout-constraint name="test-timeout-2" readTimeout="20"/>
            <timeout-constraint name="test-timeout-3" connectionTimeout="400"/>
            <timeout-constraint name="test-timeout-4"/>
        </timeout-constraints>
   
        <resolvers>
            <url name="urlresolver-1" timeoutConstraint="test-timeout-3"/>
            <ibiblio name="ibiblio-resolver" timeoutConstraint="test-timeout-1"/>
            <filesystem name="fs"/>
        </resolvers>
    </ivysettings>
   
    ```
    (explanation of what these settings signify are available in the docs here https://github.com/jaikiran/ant-ivy/commit/c0ffb23ae29197e7f47c140deb991139d0688421#diff-e094f56ed4707eb73f8621abe7bfb4e5R54)
   
    The commit also contains updates to documentation to include details of this new feature, plus test cases to verify the basic functionality of this feature on some specific resolvers.
   
    I need to check a few standard resolvers (like the ssh based ones) to make sure they honour this new timeout semantics too and include tests (if possible) for them. But at this point, this commit should cover the support and the code flow for most of the relevant resolvers like the `URLResolver`. In fact, one of the tests in this commit, actually simulates a HTTP backed repo being down, in a test case to verify the `URLResolver` honours these timeout constraints.
   
   
   


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jaikiran/ant-ivy ivy-735

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/ant-ivy/pull/54.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #54
   
----
commit c0ffb23ae29197e7f47c140deb991139d0688421
Author: Jaikiran Pai <[hidden email]>
Date:   2017-07-10T04:50:38Z

    IVY-735 Support timeouts on resolvers

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] ant-ivy issue #54: IVY-735 Support timeouts on resolvers

apupier
Github user twogee commented on the issue:

    https://github.com/apache/ant-ivy/pull/54
 
    The PR contains additional changes to HttpClientHandler, introducing HttpConnectionManagerParams, which is not available in Commons HTTP Client version 2 (over 10 years old and virtually gone). It would be appropriate to remove HttpClientHelper and related classes and methods, too.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] ant-ivy issue #54: IVY-735 Support timeouts on resolvers

apupier
In reply to this post by apupier
Github user twogee commented on the issue:

    https://github.com/apache/ant-ivy/pull/54
 
    JSch Session has a single (connection) timeout. There is a GitHub project to mock ssh/sftp server based on Mina at https://github.com/shamsoftware/sham-ssh 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] ant-ivy issue #54: IVY-735 Support timeouts on resolvers

apupier
In reply to this post by apupier
Github user twogee commented on the issue:

    https://github.com/apache/ant-ivy/pull/54
 
    VsftpRepository has DEFAULT_READ_TIMEOUT and DISCONNECT_COMMAND_TIMEOUT; would that require an additional timeout attribute?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] ant-ivy issue #54: IVY-735 Support timeouts on resolvers

apupier
In reply to this post by apupier
Github user jaikiran commented on the issue:

    https://github.com/apache/ant-ivy/pull/54
 
    >> The PR contains additional changes to HttpClientHandler, introducing HttpConnectionManagerParams, which is not available in Commons HTTP Client version 2 (over 10 years old and virtually gone).
   
    I don't understand what you meant. We use commons HTTP client 3.x https://github.com/apache/ant-ivy/blob/master/ivy.xml#L47. Do you mean we should consider supporting 2.x version of that library too?



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] ant-ivy issue #54: IVY-735 Support timeouts on resolvers

apupier
In reply to this post by apupier
Github user twogee commented on the issue:

    https://github.com/apache/ant-ivy/pull/54
 
    The code below apparently assumes that client 2.x might still be around; it is obsolete and this is a perfect opportunity to remove it
   
    ```
        private HttpClientHelper getHttpClientHelper() {
            if (httpClientHelper == null) {
                // use commons httpclient 3.0 if available
                try {
                    HttpMethodBase.class.getMethod("getResponseContentLength");
                    httpClientHelper = new HttpClientHelper3x();
                    Message.verbose("using commons httpclient 3.x helper");
                } catch (SecurityException e) {
                    Message.verbose("unable to get access to getResponseContentLength of "
                            + "commons-httpclient HeadMethod. Please use commons-httpclient 3.0 or "
                            + "use ivy with sufficient security permissions.");
                    Message.verbose("exception: " + e.getMessage());
                    httpClientHelper = new HttpClientHelper2x();
                    Message.verbose("using commons httpclient 2.x helper");
                } catch (NoSuchMethodException e) {
                    httpClientHelper = new HttpClientHelper2x();
                    Message.verbose("using commons httpclient 2.x helper");
                }
            }
            return httpClientHelper;
        }
   
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] ant-ivy issue #54: IVY-735 Support timeouts on resolvers

apupier
In reply to this post by apupier
Github user jaikiran commented on the issue:

    https://github.com/apache/ant-ivy/pull/54
 
    Gintas, thanks for pointing me to that code. I now understand what you meant.
   
    So essentially, Ivy internally tries to support both 2.x and 3.x version of HTTP client library at runtime. But at compile time we depend on 3.x version now. So it's not going to work out supporting 2.x version since we will end up using 3.x APIs at compile time. But that's a different topic altogether and something that I will raise a dev list mailing thread.
   
    In the context of this feature/change, what I have now done is - updated the commit to use the HTTP client 2.x APIs to set these timeouts. These APIs have been deprecated in 3.x but should work in both 2.x and 3.x (at least 3.1, the version we are currently using). Once/if we come to a consensus of just supporting 3.x, I will update the code in separate commits to use the newer APIs that are available in 3.x



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] ant-ivy issue #54: IVY-735 Support timeouts on resolvers

apupier
In reply to this post by apupier
Github user twogee commented on the issue:

    https://github.com/apache/ant-ivy/pull/54
 
    I'd rather have dropping support for 2.x up for vote a.s.a.p. because 3.x is [EOL](http://hc.apache.org/httpclient-3.x/) already.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] ant-ivy issue #54: IVY-735 Support timeouts on resolvers

apupier
In reply to this post by apupier
Github user jaikiran commented on the issue:

    https://github.com/apache/ant-ivy/pull/54
 
    >> VsftpRepository has DEFAULT_READ_TIMEOUT and DISCONNECT_COMMAND_TIMEOUT; would that require an additional timeout attribute?
   
    I had a look at this. Given that there's currently no way it can be configured on the resolver itself and that it looks more like an internal usage, I wouldn't expose this as an additional timeout attribute, especially since it's very specific to this resolver.
   
    In general, I think the resolver(s) should use the named `timeout-constraint` for the common timeout concepts (like connection timeout and read timeout) and if necessary specify additional timeout details that are very specific to that resolver as specific attributes on the resolver's element itself.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] ant-ivy pull request #54: IVY-735 Support timeouts on resolvers

apupier
In reply to this post by apupier
Github user asfgit closed the pull request at:

    https://github.com/apache/ant-ivy/pull/54


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] ant-ivy issue #54: IVY-735 Support timeouts on resolvers

apupier
In reply to this post by apupier
Github user jaikiran commented on the issue:

    https://github.com/apache/ant-ivy/pull/54
 
    >> So it's not going to work out supporting 2.x version since we will end up using 3.x APIs at compile time. But that's a different topic altogether and something that I will raise a dev list mailing thread.
   
    I opened a dev mailing list thread to finalize this https://www.mail-archive.com/dev@.../msg45950.html


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...