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

Michael Osipov commented on WAGON-545:
--------------------------------------

For testing purposes I have set a fixed TTL of {{15 s}} and I see now a bunch 
of:
{noformat}
56408 [BasicRepositoryConnector-repo.maven.apache.org-2-4] [DEBUG] CPool - 
Connection [id:6][route:{s}->https://repo.maven.apache.org:443][state:null] 
expired @ Sun Jan 27 21:46:31 CET 2019
{noformat}

So started debugging, something is fishy about the code:

{code:java}
    private static final long CONN_TTL =
        Long.getLong( "maven.wagon.httpconnectionManager.ttlSeconds", 300L );
{code}

as soon as I pass a value, it will be coerced to {{0}}. After some digging I 
discovered that this is purely my fault. The verification of WAGON-486 happened 
with a literal value. The patch applied by me in master suffers from 
[this|https://stackoverflow.com/q/5989532/696632]. At the end the patch had no 
effect. A local modification does the right thing now. Though, I would prefer 
to use the evict idle connection feature rather than TTL, but that requires the 
background thread to be cleaned up properly. That is currently not possible 
with the way Wagon is written.

[~olegk], thank you very much again. You gave me proper pointers to figure out 
the cause. There is still a question open: why do we have connection resets on 
Maven Central? It is either the outboud connection with the NAT on Azure or the 
inbound reverse proxy of Maven Central has a 5 min cap without a proper 
keep-alive header.
[~brianf], is there a time cap on Maven Central for inbound connections?

> Connection reset while downloading artefacts in cloud environment (Azure)
> -------------------------------------------------------------------------
>
>                 Key: WAGON-545
>                 URL: https://issues.apache.org/jira/browse/WAGON-545
>             Project: Maven Wagon
>          Issue Type: Bug
>          Components: wagon-http
>    Affects Versions: 3.2.0
>         Environment: Microsoft Azure 'Hosted VS2017'
>            Reporter: Christian Domsch
>            Priority: Major
>             Fix For: waiting-for-feedback
>
>         Attachments: log_10_310.zip, log_10_311.zip, log_10_325.zip
>
>
> We are building a huge multi-module project in the azure cloud and experience 
> random connection resets during our build due to probably the same issue as 
> in WAGON-486. Since it is stated by Microsoft that they terminate connections 
> that are idle for longer than four minutes (see solution comment 
> [here|https://developercommunity.visualstudio.com/content/problem/357696/maven-project-build-failing-with-connection-reset.html],
>  I set -Dmaven.wagon.httpconnectionManager.ttlSeconds=120. Also, disabling 
> the http pool does not solve the problem. Attached are logs from out main 
> build with logging turned on for the wagon components, as mentioned in the 
> comment section of WAGON-486.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to