[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17314828#comment-17314828 ] Michael Osipov commented on WAGON-575: -- No reaction from Rory, can someone confirm that JDK-8237578 solves the issue? > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: New Feature > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Minor > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Launcher.java:406)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.main > (Launcher.java:347)}} > {{Caused by: org.apache.maven.project.DependencyResolutionException: Could > not resolve dependencies for project test:test:jar:1.0.0: Could not transfer > artifact REDACTED from/to REDACTED (REDACTED): GET request of:
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17286027#comment-17286027 ] Michael Osipov commented on WAGON-575: -- I wrote Rory O'Donnell from Oracle. Let's what they write. > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: New Feature > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Minor > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Launcher.java:406)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.main > (Launcher.java:347)}} > {{Caused by: org.apache.maven.project.DependencyResolutionException: Could > not resolve dependencies for project test:test:jar:1.0.0: Could not transfer > artifact REDACTED from/to REDACTED (REDACTED): GET request of: REDACTED from > R
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17277726#comment-17277726 ] Igor Dvorzhak commented on WAGON-575: - [~michael-o] Yes, I think that 8u and 11u both are affected - this bug was introduced in [JDK-8145252|https://bugs.openjdk.java.net/browse/JDK-8145252] that added TLS v1.3 support in JDK 8 and 11+ > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: New Feature > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Minor > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Launcher.java:406)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.main > (Launcher.java:347)}} > {{Caused by: org.apache.maven.project.DependencyResolutionException: Could > not resolve dependencie
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17276265#comment-17276265 ] Michael Osipov commented on WAGON-575: -- [~medb], I can contact Oracle guys about this. Which version is affected 8u only or 11u as well? > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: New Feature > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Minor > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Launcher.java:406)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.main > (Launcher.java:347)}} > {{Caused by: org.apache.maven.project.DependencyResolutionException: Could > not resolve dependencies for project test:test:jar:1.0.0: Could not transfer > artifact REDACTED from/to REDACTED (REDACT
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17269843#comment-17269843 ] Igor Dvorzhak commented on WAGON-575: - After looking closer in the root cause of this issues, I believe that it is caused by [SSLSocketImpl erroneously wraps SocketException|https://bugs.openjdk.java.net/browse/JDK-8214339] issue in OpenJDK. While original issue affects OpenJDK 11 and was already [partially fixed|https://bugs.openjdk.java.net/browse/JDK-8237578], it was [back-ported to OpenJDK 8u272|https://github.com/AdoptOpenJDK/openjdk-jdk8u/commit/b03902ff772e9a1638054094a7140d95a6083f1d] too. This also confirmed by stack trace: {code:java} Failed to download com/google/code/tempus-fugit/tempus-fugit/1.1/tempus-fugit-1.1.jar to /home/bigtop/.m2/repository/com/google/code/tempus-fugit/tempus-fugit/1.1/tempus-fugit-1.1.jar.part (attempt #1): org.apache.maven.wagon.TransferFailedException: Transfer failed for https://repo.maven.apache.org/maven2/com/google/code/tempus-fugit/tempus-fugit/1.1/tempus-fugit-1.1.jar at org.apache.maven.wagon.providers.http.wagon.shared.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:1242) at org.apache.maven.wagon.providers.http.wagon.shared.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:1138) at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:167) at org.apache.maven.wagon.StreamWagon.getIfNewerInternal(StreamWagon.java:129) at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:96) at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:63) at org.eclipse.aether.transport.wagon.WagonTransporter$GetTaskRunner.run(WagonTransporter.java:567) at org.eclipse.aether.transport.wagon.WagonTransporter.execute(WagonTransporter.java:435) at org.eclipse.aether.transport.wagon.WagonTransporter.get(WagonTransporter.java:412) at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:457) at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:364) at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:75) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: javax.net.ssl.SSLException: Connection reset at sun.security.ssl.Alert.createSSLException(Alert.java:127) at sun.security.ssl.TransportContext.fatal(TransportContext.java:324) at sun.security.ssl.TransportContext.fatal(TransportContext.java:267) at sun.security.ssl.TransportContext.fatal(TransportContext.java:262) at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1303) at sun.security.ssl.SSLSocketImpl.access$300(SSLSocketImpl.java:72) at sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:831) at org.apache.maven.wagon.providers.http.httpclient.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:137) at org.apache.maven.wagon.providers.http.httpclient.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:153) at org.apache.maven.wagon.providers.http.httpclient.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:280) at org.apache.maven.wagon.providers.http.httpclient.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138) at org.apache.maven.wagon.providers.http.httpclient.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56) at org.apache.maven.wagon.providers.http.httpclient.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259) at org.apache.maven.wagon.providers.http.httpclient.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163) at org.apache.maven.wagon.providers.http.httpclient.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:157) at org.apache.maven.wagon.providers.http.httpclient.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273) at org.apache.maven.wagon.providers.http.httpclient.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125) at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.MainClientExec.execute(MainClientExec.java:272) at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186) at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec.execute(RetryExec.java:89) at org.apache.maven.
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17245396#comment-17245396 ] Michael Osipov commented on WAGON-575: -- Some assumptions do not apply which I have made. Resets are properly performed. I am still rejecting the PR after rereading all comments and our codebsae and will explain why: * First of all {{TransferFailedException}} wraps: {code} catch ( IOException | HttpException | InterruptedException e ) { fireTransferError( resource, e, TransferEvent.REQUEST_PUT ); throw new TransferFailedException( formatTransferFailedMessage( url, getProxyInfo() ), e ); } {code} Not all I/O exceptions can be recovered. {{HttpException}} is so generic that most of the subtypes cannot be recovered from. This is not a way to go. Especially not on such a high level because the changeset in the PR applies to all stream wagons. Basically [~olegk] has already provide the way to go. One needs to utilize {{org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.createRetryHandler()}} inside {{org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.fillInputData(int, InputData)}} to make work what you have in mind. That is something I would really consider to include when there is a test depicting that it works. This would not require to introduce any new user visiable changes. > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: New Feature > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Minor > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:1
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17245321#comment-17245321 ] Igor Dvorzhak commented on WAGON-575: - I can add configuration if retry mechanism is acceptable in general. It retries only `TransferFailedException` exceptions. I expect that wrong credentials are covered by `AuthorizationException` exceptions that are not retried. These PR is not dealing with `InputStream` and progress tracking because it retries whole file download e2e. I agree that retries on a lower level will be a better and more efficient solution, but from discussion in this thread I understood that nobody has a time to implement them, so I proposed a quick fix that solves this problem. > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: New Feature > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Minor > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at o
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17245047#comment-17245047 ] Michael Osipov commented on WAGON-575: -- I am not really happy with the PR: * It ist not configurable * It solves a symptom on the wrong spot. * It may retry even if th request has not been retried. Consider your credentials are incorrect and it will try 5 times, your account gets locked. * Wagon also tracks progress. If those counters aren't reset it will fail with another exception. Don't know whether this applies here. I would prefer to solve it by HttpClient means if this is possible. Moreover, if the failure is in flight the caller must be able to recover from this, meanning that Wagon receives an output stream and it needs to track where it failed to resule download. You cannot rewind the output stream you have received. If I am wrong, please explain. > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: New Feature > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Minor > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} >
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17244923#comment-17244923 ] Igor Dvorzhak commented on WAGON-575: - I have sent a [PR|https://github.com/apache/maven-wagon/pull/75] that fixes this issue by adding high-level retries for failed downloads. It's less efficient retry mechanism than what was discussed in the comments above but much simpler to implement and solves the issue for my build. Please, let me know if this is something that you are willing to consider/merge with some additional work (configuration, tests, etc). > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: New Feature > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Minor > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWit
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17042738#comment-17042738 ] Michael Osipov commented on WAGON-575: -- That is going to require * the server to accept ranges * us to memorize that * resume the download and likely other stuff. While this sounds like a very interesting task it takes a serious amount of time to implement that. > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: New Feature > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Minor > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Launcher.java:406)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.main > (Launcher.java:347)}} > {{Caused by: org.apache.maven.project.DependencyResolutionException: Cou
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17042722#comment-17042722 ] Oleg Kalnichevski commented on WAGON-575: - [~michael-o] [~MickeM] Another thing to consider is making HttpWagon able to resume download from the last good position of the previous failed request. Oleg > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: New Feature > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Minor > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Launcher.java:406)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.main > (Launcher.java:347)}} > {{Caused by: org.apache.maven.project.DependencyResolutionException: Could > not resolve dependencies for project test:test:jar:1.
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17024323#comment-17024323 ] Michael Osipov commented on WAGON-575: -- bq. Does this mean retry for connection issue is beyond the scope of maven, wagon, http client or all of them? As mentioned by Oleg, not all all, but not in HttpClient. This would require HttpClient to pipe through the input stream, catch exceptions and handle them for your. This is best handled in client code. This has to be implemented in Wagon. It is not that easy, these things have to be observed: * Shall this apply for GET only? Or all idempotent requests? * Wagon triggers events on state change, this needs to added * New properties for a retry count have to be added * Counts needs to be maintained with new methods * How to test this? One needs to send a TCP RST, I was manage to do that by killing the Tomcat process. Does not seems to be feasible in unit tests. Unless someone makes a proposal, this will have a low priority for me since I mostly focus on bugs in Wagon. > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: Improvement > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Major > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorIm
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17024204#comment-17024204 ] Oleg Kalnichevski commented on WAGON-575: - [~MickeM] It cannot be adequately dealt with in HttpClient but may be a reasonable feature for Wagon to consider. Oleg > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: Improvement > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Major > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Launcher.java:406)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.main > (Launcher.java:347)}} > {{Caused by: org.apache.maven.project.DependencyResolutionException: Could > not resolve dependencies for project test:test:jar:1.0.0: Could not transfer > artifact RED
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17023922#comment-17023922 ] Michael Medin commented on WAGON-575: - Does this mean retry for connection issue is beyond the scope of maven, wagon, http client or all of them? I would hope that retry with resume for connection issues would be a feature for anything with deals with downloading files today... > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: Improvement > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Major > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Launcher.java:406)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.main > (Launcher.java:347)}} > {{Caused by: org.apache.maven.project.DependencyResolutio
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17023775#comment-17023775 ] Oleg Kalnichevski commented on WAGON-575: - [~michael-o] Better documentation is always welcome. Oleg > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: Improvement > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Major > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Launcher.java:406)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.main > (Launcher.java:347)}} > {{Caused by: org.apache.maven.project.DependencyResolutionException: Could > not resolve dependencies for project test:test:jar:1.0.0: Could not transfer > artifact REDACTED from/to REDACTED (REDACTED): GET request of: REDACTED fro
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17023660#comment-17023660 ] Michael Osipov commented on WAGON-575: -- [~olegk], this is what I was afraid of. It needs to be outside of HttpClient code. The HttpClient cannot recover from because it does not have control over the entity's input stream. [~MickeM], this issue is basically invalid because wrong assumptions/expectatations have been made. You need likely an improvement in Wagon. I agree that documentation should be better to avoid such misunderstandings. [~olegk], do we need to improve HttpClient docs as well to avoid misunderstandings like this? > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: Improvement > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Major > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17023627#comment-17023627 ] Oleg Kalnichevski commented on WAGON-575: - [~michael-o] This may do the trick. {code:java} public static void main(String... args) throws Exception { try (CloseableHttpClient client = HttpClientBuilder.create() .setRetryHandler((exception, executionCount, context) -> false) .build()) { HttpClientContext clientContext = HttpClientContext.create(); HttpRequestRetryHandler retryHandler = new DefaultHttpRequestRetryHandler(3, false); for (int count = 0;; count++) { HttpUriRequest request = new HttpGet("http://localhost:8080/bb/test";); try (CloseableHttpResponse response = client.execute(request, clientContext); OutputStream os = Files.newOutputStream(Files.createTempFile("retry-", null))) { response.getEntity().writeTo(os); break; } catch (IOException ex) { if (!retryHandler.retryRequest(ex, count, clientContext)) { break; } } } } } {code} Oleg > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: Improvement > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Major > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17023616#comment-17023616 ] Michael Osipov commented on WAGON-575: -- OK, I know what happens now, but don't have a decent solution for. What have I done? Written simple with HC 4.4.x and HC 5.0-beta7 {code:java} public static void main(String... args) throws IOException { try (CloseableHttpClient client = HttpClientBuilder.create() .setRetryStrategy(new DefaultHttpRequestRetryStrategy()).build()) { HttpUriRequest request = new HttpGet( "http://localhost:8080/bb/test";); try (CloseableHttpResponse response = client.execute(request); OutputStream os = Files.newOutputStream(Files.createTempFile("retry-", null))) { response.getEntity().writeTo(os); } } } {code} Downloading the Windows 10 ISO (ca. 7 GB) from a local Tomcat instance. Killed the Tomcat instance inflight, the retry handler did not kick in. I had my socket exception with "Connection reset". I set a breakpoint in {{response = chain.proceed(currentRequest, scope);}} in the chain exec handler. As soon as the request starts and no I/O exception happens th handler is existed. {{retryStrategy.retryRequest(response, execCount, context)}} is immediately executed when response headers have arrived. All inflight failures are ignored/not handled. This looks weird, agreed. But when you think about this, it makes sense becaue the in-flight I/O exception happens when {{response.getEntity().writeTo(os);}} is called. The retry handler has already been processed before. > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: Improvement > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Major > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifec
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17023497#comment-17023497 ] Michael Osipov commented on WAGON-575: -- I need to set up a separate case with HttpClient code and a remote server and then plug the cable and see how good the client recovers. This will take a few days. You try it yourself. I really don't want to add any code to Wagon if HttpClient provides the same features. > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: Improvement > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Major > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Launcher.java:406)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.main > (Launcher.java:347)}} > {{Caused by: org.apache
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17023470#comment-17023470 ] Michael Medin commented on WAGON-575: - If you check my post above I use a custom handler which is never called... If you check the code in the stack trace there is no retry handler... It is only used for the connect call until it parses the headers then wagon gets an input steam which has no retry handler... So I'd say the retry should be in wagon not http client based on how it is used but I haven't looked at it in detail... // Michael > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: Improvement > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Major > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Lau
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17023188#comment-17023188 ] Michael Osipov commented on WAGON-575: -- :( The default retry handler does not contain any logging so this is a blind flight. Do you think you good set a breakpoint on the the handler as see whether it is called at all? > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: Improvement > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Major > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Launcher.java:406)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.main > (Launcher.java:347)}} > {{Caused by: org.apache.maven.project.DependencyResolutionException: Could > not resolve dependencies for project te
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17022909#comment-17022909 ] Michael Medin commented on WAGON-575: - Here is the log from httpclient: [DEBUG] Using transporter WagonTransporter with priority -1.0 for REDACTED [DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for REDACTED Downloading from REDACTED: REDACTED [DEBUG] CookieSpec selected: compatibility [DEBUG] Connection request: [route: \{s}->https://REDACTED:443][total kept alive: 0; route allocated: 0 of 20; total allocated: 0 of 40] [DEBUG] Connection leased: [id: 0][route: \{s}->https://REDACTED:443][total kept alive: 0; route allocated: 1 of 20; total allocated: 1 of 40] [DEBUG] Opening connection \{s}->https://REDACTED:443 [DEBUG] Connecting to REDACTED/REDACTED:443 [DEBUG] Connecting socket to REDACTED/REDACTED:443 with timeout 0 [DEBUG] Enabled protocols: [TLSv1.3, TLSv1.2, TLSv1.1, TLSv1] [DEBUG] Enabled cipher suites:[TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV] [DEBUG] Starting handshake [DEBUG] Secure session established [DEBUG] negotiated protocol: TLSv1.2 [DEBUG] negotiated cipher suite: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 [DEBUG] peer principal: CN=REDACTED, OU=Domain Control Validated [DEBUG] peer alternative names: [REDACTED, REDACTED] [DEBUG] issuer principal: CN=Starfield Secure Certificate Authority - G2, OU=http://certs.starfieldtech.com/repository/, O="Starfield Technologies, Inc.", L=Scottsdale, ST=Arizona, C=US [DEBUG] Connection established REDACTED:51034<->REDACTED:443 [DEBUG] http-outgoing-0: set socket timeout to 180 [DEBUG] Executing request GET REDACTED HTTP/1.1 [DEBUG] Target auth state: UNCHALLENGED [DEBUG] Proxy auth state: UNCHALLENGED [DEBUG] http-outgoing-0 >> GET REDACTED HTTP/1.1 [DEBUG] http-outgoing-0 >> Cache-control: no-cache [DEBUG] http-outgoing-0 >> Cache-store: no-store [DEBUG] http-outgoing-0 >> Pragma: no-cache [DEBUG] http-outgoing-0 >> User-Agent: Apache-Maven/3.6.2 (Java 11.0.4; Windows 10 10.0) [DEBUG] http-outgoing-0 >> Host: REDACTED [DEBUG] http-outgoing-0 >> Connection: Keep-Alive [DEBUG] http-outgoing-0 >> Accept-Encoding: gzip,deflate [DEBUG] http-outgoing-0 >> "GET REDACTED HTTP/1.1[\r][\n]" [DEBUG] http-outgoing-0 >> "Cache-control: no-cache[\r][\n]" [DEBUG] http-outgoing-0 >> "Cache-store: no-store[\r][\n]" [DEBUG] http-outgoing-0 >> "Pragma: no-cache[\r][\n]" [DEBUG] http-outgoing-0 >> "User-Agent: Apache-Maven/3.6.2 (Java 11.0.4; Windows 10 10.0)[\r][\n]" [DEBUG] http-outgoing-0 >> "Host: REDACTED[\r][\n]" [DEBUG] http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]" [DEBUG] http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]" [DEBUG] http-outgoing-0 >> "[\r][\n]" [DEBUG] http-outgoing-0 << "HTTP/1.1 200 OK[\r][\n]" [DEBUG] http-outgoing-0 << "Server: nginx/1.15.9 (Ubuntu)[\r][\n]" [DEBUG] http-outgoing-0 << "Date: Fri, 24 Jan 2020 06:02:16 GMT[\r][\n]" [DEBUG] http-outgoing-0 << "Content-Type: application/java-archive[\r][\n]" [DEBUG] http-outgoing-0 << "Content-Length: 946377354[\r][\n]" [DEBUG] http-outgoing-0 << "Connection: keep-alive[\r][\n]" [DEBUG] http-outgoing-0 << "Keep-Alive: timeout=5[\r][\n]" [DEBUG] http-outgoing-0 << "X-Content-Type-Options: nosniff[\r][\n]" [DEBUG] http-outgoing-0 << "Content-Security-Policy: sandbox al
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17022262#comment-17022262 ] Michael Osipov commented on WAGON-575: -- Let's wait for the debug logs. > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: Improvement > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Major > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Launcher.java:406)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.main > (Launcher.java:347)}} > {{Caused by: org.apache.maven.project.DependencyResolutionException: Could > not resolve dependencies for project test:test:jar:1.0.0: Could not transfer > artifact REDACTED from/to REDACTED (REDACTED): GET request of: REDACTED from > REDACTED failed}} > {{ at org
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17022158#comment-17022158 ] Oleg Kalnichevski commented on WAGON-575: - [~michael-o] HttpClient with default settings should automatically retry `safe` requests upon an I/O error such as a connection reset. I am not quite sure why it does not happen here. Oleg > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: Improvement > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Major > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Launcher.java:406)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.main > (Launcher.java:347)}} > {{Caused by: org.apache.maven.project.DependencyResolutionException: Could > not resolve dependenc
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17022154#comment-17022154 ] Michael Medin commented on WAGON-575: - This was without any particular config but I get the same result configuring a retryhandler. I will see if I can figure out how to enable logging and re-run this, but here is some more details regarding my config, setup and tests... pom file: http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd";> 4.0.0 test test 1.0.0 jar se.pricer.esl delta 114.0.0-44634bb provided settings.xml pricer external:* REDACTED I get same results with: {{mvn clean install -X -Dmaven.wagon.http.retryHandler.requestSentEnabled=true -Dmaven.wagon.http.retryHandler.class=default -Dmaven.wagon.http.retryHandler.count=5}} and: {{mvn clean install -X}} Also writing a custom RetryHandler I get constructor but no call to retryRequest: {{mvn clean install -X -Dmaven.wagon.http.retryHandler.class=medin.name.Test}} RetryHandler I use: {{package medin.name;}}{{import java.io.IOException;}} {{import org.apache.maven.wagon.providers.http.httpclient.client.HttpRequestRetryHandler;}} {{import org.apache.maven.wagon.providers.http.httpclient.protocol.HttpContext;}}{{public class Test implements HttpRequestRetryHandler {}} {{ public Test() {}} {{ System.out.println("->LOADING");}} {{ System.out.println("->LOADING");}} {{ System.out.println("->LOADING");}} {{ System.out.println("->LOADING");}} {{ System.out.println("->LOADING");}} {{ System.out.println("->LOADING");}} {{ System.out.println("->LOADING");}} {{ }}}{{public boolean retryRequest(IOException e, int i, HttpContext httpContext) {}} {{ System.out.println("->");}} {{ System.out.println("->");}} {{ System.out.println("->");}} {{ System.out.println("->");}} {{ System.out.println("->");}} {{ System.out.println("->" + e);}} {{ System.out.println("->" + i);}} {{ System.out.println("->" + httpContext);}} {{ return false;}} {{ }}} {{}}} Log: {{...}}{{[DEBUG] stax:stax-api:jar:1.0.1:provided}} {{->LOADING}} {{->LOADING}} {{->LOADING}} {{->LOADING}} {{->LOADING}} {{->LOADING}} {{->LOADING}} {{[DEBUG] Using transporter WagonTransporter with priority -1.0 for REDACTED}} {{[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for REDACTED}} {{Downloading from REDACTED: REDACTED}} {{[DEBUG] Writing tracking file REDACTED}} {{[INFO] }} {{[INFO] BUILD FAILURE}} {{[INFO] }} {{[INFO] Total time: 12.160 s}} {{[INFO] Finished at: 2020-01-23T15:37:15+01:00}} {{[INFO] }} {{[ERROR] Failed to execute goal on project test: Could not resolve dependencies for project test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED: GET request of: REDACTED from REDACTED failed: Connection reset -> [Help 1]}} {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project test: Could not resolve dependencies for project test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED: GET request of: REDACTED from REDACTED failed}} {{ at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:269)}} {{ at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:147)}} {{ at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:248)}} {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:202)}} {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)}} {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)}} {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)}} {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)}} {{ at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)}} {{ at org.apache.maven.lifecycle.
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17022096#comment-17022096 ] Michael Osipov commented on WAGON-575: -- [~olegk], I assume that the old and the new {{HttpRequestRetryStrategy}} do not qualify for in-flight retry? [~MickeM], can you provide debug output of the HttpClient (https://github.com/apache/maven/blob/master/maven-embedder/src/main/resources/META-INF/maven/slf4j-configuration.properties) and the exact configuration you passed to Maven? > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: Improvement > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Major > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Launcher.java:406)}} > {{ at org.codehaus.plexus.classworlds.
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17022094#comment-17022094 ] Michael Medin commented on WAGON-575: - Same thing with Java 8 (Exception is not wrapped but the issue remains): {{mvn clean install -X}} {{Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)}} {{Maven home: C:\java\apache-maven-3.6.3\bin\..}} {{Java version: 1.8.0_242, vendor: AdoptOpenJDK, runtime: C:\java\jdk8u242-b08\jre}} {{Default locale: sv_SE, platform encoding: Cp1252}} {{OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"}} {{...}} {{Caused by: org.apache.maven.wagon.TransferFailedException: GET request of: REDACTED from REDACTED failed}} {{ at org.apache.maven.wagon.AbstractWagon.getTransfer (AbstractWagon.java:412)}} {{ at org.apache.maven.wagon.AbstractWagon.getTransfer (AbstractWagon.java:338)}} {{ at org.apache.maven.wagon.AbstractWagon.getTransfer (AbstractWagon.java:307)}} {{ at org.apache.maven.wagon.StreamWagon.getIfNewer (StreamWagon.java:97)}} {{ at org.apache.maven.wagon.StreamWagon.get (StreamWagon.java:61)}} {{ at org.eclipse.aether.transport.wagon.WagonTransporter$GetTaskRunner.run (WagonTransporter.java:567)}} {{ at org.eclipse.aether.transport.wagon.WagonTransporter.execute (WagonTransporter.java:435)}} {{ at org.eclipse.aether.transport.wagon.WagonTransporter.get (WagonTransporter.java:412)}} {{ at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask (BasicRepositoryConnector.java:457)}} {{ at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run (BasicRepositoryConnector.java:364)}} {{ at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run (RunnableErrorForwarder.java:75)}} {{ at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute (BasicRepositoryConnector.java:644)}} {{ at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get (BasicRepositoryConnector.java:262)}} {{ at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads (DefaultArtifactResolver.java:499)}} {{ at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:401)}} {{ at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:229)}} {{ at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies (DefaultRepositorySystem.java:340)}} {{ at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve (DefaultProjectDependenciesResolver.java:202)}} {{ at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:243)}} {{ at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:147)}} {{ at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:248)}} {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:202)}} {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)}} {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)}} {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)}} {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)}} {{ at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)}} {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)}} {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} {{ at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} {{ at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)}} {{ at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)}} {{ at java.lang.reflect.Method.invoke (Method.java:498)}} {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)}} {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)}} {{ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)}} {{ at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)}} {{Caused by: java.net.SocketException: Connection reset}} {{ at java.net.SocketInputStream.read (SocketInputStream.java:210)}} {{ a
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17022082#comment-17022082 ] Michael Medin commented on WAGON-575: - Nothing seems changed in 2020-01-15 build of Java 14, will try with Java 8 as well... {{mvn clean install -X}} {{Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)}} {{Maven home: C:\java\apache-maven-3.6.3\bin\..}} {{Java version: 14-ea, vendor: Oracle Corporation, runtime: C:\java\jdk-14}} {{Default locale: sv_SE, platform encoding: Cp1252}} {{OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"}} {{...}} {{[ERROR] Failed to execute goal on project test: Could not resolve dependencies for project test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED (REDACTED): GET request of: REDACTED from REDACTED failed: Connection reset -> [Help 1]}} {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project test: Could not resolve dependencies for project test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED (REDACTED): GET request of: REDACTED from REDACTED failed}} {{ at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:269)}} {{ at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:147)}} {{ at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:248)}} {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:202)}} {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)}} {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)}} {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)}} {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)}} {{ at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)}} {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)}} {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)}} {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)}} {{ at java.lang.reflect.Method.invoke (Method.java:564)}} {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)}} {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)}} {{ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)}} {{ at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)}} {{...}} {{Caused by: org.apache.maven.wagon.TransferFailedException: GET request of: REDACTED from REDACTED failed}} {{ at org.apache.maven.wagon.AbstractWagon.getTransfer (AbstractWagon.java:412)}} {{ at org.apache.maven.wagon.AbstractWagon.getTransfer (AbstractWagon.java:338)}} {{ at org.apache.maven.wagon.AbstractWagon.getTransfer (AbstractWagon.java:307)}} {{ at org.apache.maven.wagon.StreamWagon.getIfNewer (StreamWagon.java:97)}} {{ at org.apache.maven.wagon.StreamWagon.get (StreamWagon.java:61)}} {{ at org.eclipse.aether.transport.wagon.WagonTransporter$GetTaskRunner.run (WagonTransporter.java:567)}} {{ at org.eclipse.aether.transport.wagon.WagonTransporter.execute (WagonTransporter.java:435)}} {{ at org.eclipse.aether.transport.wagon.WagonTransporter.get (WagonTransporter.java:412)}} {{ at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask (BasicRepositoryConnector.java:457)}} {{ at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run (BasicRepositoryConnector.java:364)}} {{ at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run (RunnableErrorForwarder.java:75)}} {{ at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute (BasicRepositoryConnector.java:644)}} {{ at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get (BasicRepositoryConnector.java:262)}} {{ at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads (DefaultArtifactResolver.java:499)}} {{ at org.eclipse.aet
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17021911#comment-17021911 ] Michael Osipov commented on WAGON-575: -- That might be true, but I like to see the raw {{IOException}} and not the wrapped one in Java 11. > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: Improvement > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Major > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Launcher.java:406)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.main > (Launcher.java:347)}} > {{Caused by: org.apache.maven.project.DependencyResolutionException: Could > not resolve dependencies for project test:test:jar:1.0.0: Could not transfer > artifact REDACTED from/to REDACTED (REDAC
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17021883#comment-17021883 ] Michael Medin commented on WAGON-575: - I went down that route myself and thats why I wanted to add a custom retry handler. But I do not think that is the case as the RetryHandler is never called at all when the exception happens the constructor is called but never the retry function. The code for downloading the file happens (wagon copy stream) after the handshake so I dot not see how it could retry regardless of what exception is thrown from the underlying exception type. But I will see if I can setup an early access build of java 14 and reproduce it there. > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: Improvement > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Major > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at org.codehaus.plexus.classworlds.launch
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17021879#comment-17021879 ] Michael Osipov commented on WAGON-575: -- Let me guess, you are using Java 11? You have been hit by https://bugs.openjdk.java.net/browse/JDK-8235263. Please retry with Java 8 or 14 and report back. > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: Improvement > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Major > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Launcher.java:406)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.main > (Launcher.java:347)}} > {{Caused by: org.apache.maven.project.DependencyResolutionException: Could > not resolve dependencies for project test:test:jar:1.0.0: Coul
[jira] [Commented] (WAGON-575) Retry for connection issues
[ https://issues.apache.org/jira/browse/WAGON-575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17021385#comment-17021385 ] Michael Osipov commented on WAGON-575: -- I will look at this later today or tomorrow. > Retry for connection issues > --- > > Key: WAGON-575 > URL: https://issues.apache.org/jira/browse/WAGON-575 > Project: Maven Wagon > Issue Type: Improvement > Components: wagon-http >Affects Versions: 3.3.4 > Environment: windows and linux >Reporter: Michael Medin >Priority: Major > > There are a RetryHandler and now also a ServiceRetryHandler but both seem to > focus only the handshake and no the data stream. > In our case we download large artifacts (1+Gb) over a sometimes shaky > connection which causes frequent "Connection reset" issues. > To mitigate this we started to implement retry logic based on this > [https://maven.apache.org/wagon/wagon-providers/wagon-http/] document. But > seems our retry handler is never invoked when the connection is reset. > So after some digging into the source code it seems the retryhandler are only > used when connecting to the server and once the connection has been > established and the HTTP headers have been read there is no retry handling > for the reminder stream copy. > Looking at the code it seems non trivial to add retry for this at is split up > so I wanted to know if I am missing something before looking at implementing > a PR for this. > > A simple way to simulate this behavior is to start a maven build with some > large dependencies and during the download phase just kill the internet > connection. > If you have a RetryHandler enabled it will never be called instead you will > get a stack trace along the following: > {{[ERROR] Failed to execute goal on project test: Could not resolve > dependencies for project test:test:jar:1.0.0: Could not transfer artifact > REDACTED from/to REDACTED from REDACTED failed: Connection reset -> [Help 1]}} > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal on project test: Could not resolve dependencies for project > test:test:jar:1.0.0: Could not transfer artifact REDACTED from/to REDACTED > (REDACTED): GET request of: REDACTED from REDACTED failed}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies > (LifecycleDependencyResolver.java:269)}} > {{ at > org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies > (LifecycleDependencyResolver.java:147)}} > {{ at > org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved > (MojoExecutor.java:248)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:202)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:156)}} > {{ at org.apache.maven.lifecycle.internal.MojoExecutor.execute > (MojoExecutor.java:148)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:117)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject > (LifecycleModuleBuilder.java:81)}} > {{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build > (SingleThreadedBuilder.java:56)}} > {{ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute > (LifecycleStarter.java:128)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)}} > {{ at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)}} > {{ at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)}} > {{ at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)}} > {{ at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)}} > {{ at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)}} > {{ at jdk.internal.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:62)}} > {{ at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.java:43)}} > {{ at java.lang.reflect.Method.invoke (Method.java:566)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced > (Launcher.java:282)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.launch > (Launcher.java:225)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode > (Launcher.java:406)}} > {{ at org.codehaus.plexus.classworlds.launcher.Launcher.main > (Launcher.java:347)}} > {{Caused by: org.apache.maven.project.DependencyResolutionException: Could > not resolve dependencies for project test:test:jar:1.0.0: Could not transfer > artifact REDACTED from/to REDACTED (REDACTED): GET request of: REDACTED from > REDACTED failed