[ 
https://issues.apache.org/jira/browse/IVY-735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16095878#comment-16095878
 ] 

ASF GitHub Bot commented on IVY-735:
------------------------------------

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 <[email protected]>
Date:   2017-07-10T04:50:38Z

    IVY-735 Support timeouts on resolvers

----


> Timeout should be able to be specified
> --------------------------------------
>
>                 Key: IVY-735
>                 URL: https://issues.apache.org/jira/browse/IVY-735
>             Project: Ivy
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 2.0.0-beta-1
>            Reporter: Testo Nakada
>            Assignee: jaikiran pai
>         Attachments: 0001-Add-timeout-support-for-HTTP-requests.patch
>
>
> It's currently not possible to provide timeout for resolver. For example, 
> yesterday ibiblio is really slow. I waited almost forever just to know that 
> there is something wrong with ibiblio. It would be nice if I can specify 
> timeout so that i can fail over to some other resolvers in my chain resolver.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to