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

Michael Osipov commented on WAGON-568:
--------------------------------------

[~olegk], I have been chewing on this for quite a while now. The offending code 
is: 
https://github.com/apache/maven-wagon/blob/master/wagon-providers/wagon-http-shared/src/main/java/org/apache/maven/wagon/shared/http/AbstractHttpClientWagon.java#L177-L229

I can clearly see in a local test that it just blocks the read:

{noformat}
[main] DEBUG org.apache.http.client.protocol.RequestAddCookies - CookieSpec 
selected: compatibility
[main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - 
Connection request: [route: {}->http://localhost:61326][total kept alive: 0; 
route allocated: 0 of 20; total allocated: 0 of 40]
[main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - 
Connection leased: [id: 0][route: {}->http://localhost:61326][total kept alive: 
0; route allocated: 1 of 20; total allocated: 1 of 40]
[main] DEBUG org.apache.http.impl.execchain.MainClientExec - Opening connection 
{}->http://localhost:61326
[main] DEBUG org.apache.http.impl.conn.DefaultHttpClientConnectionOperator - 
Connecting to localhost/127.0.0.1:61326
[main] DEBUG org.apache.http.impl.conn.DefaultHttpClientConnectionOperator - 
Connection established 127.0.0.1:61331<->127.0.0.1:61326
[main] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection - 
http-outgoing-0: set socket timeout to 1800000
[main] DEBUG org.apache.http.impl.execchain.MainClientExec - Executing request 
PUT /test-secured-put-resource HTTP/1.1
[main] DEBUG org.apache.http.impl.execchain.MainClientExec - Target auth state: 
UNCHALLENGED
[main] DEBUG org.apache.http.impl.execchain.MainClientExec - Proxy auth state: 
UNCHALLENGED
[main] DEBUG org.apache.http.headers - http-outgoing-0 >> PUT 
/test-secured-put-resource HTTP/1.1
[main] DEBUG org.apache.http.headers - http-outgoing-0 >> Cache-control: 
no-cache
[main] DEBUG org.apache.http.headers - http-outgoing-0 >> Cache-store: no-store
[main] DEBUG org.apache.http.headers - http-outgoing-0 >> Pragma: no-cache
[main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Length: 14
[main] DEBUG org.apache.http.headers - http-outgoing-0 >> Host: localhost:61326
[main] DEBUG org.apache.http.headers - http-outgoing-0 >> Connection: Keep-Alive
[main] DEBUG org.apache.http.headers - http-outgoing-0 >> User-Agent: 
Apache-HttpClient/4.5.9 (Java/11.0.1)
[main] DEBUG org.apache.http.headers - http-outgoing-0 >> Accept-Encoding: 
gzip,deflate
call count: 1
Right before read, dst remaining: 4096
 available: 14
Calling read(byte: [B@79179359, int: 0, int: 4096)
Right before read, dst remaining: 4082
 available: 0
Calling read(byte: [B@79179359, int: 0, int: 4082)
[main] DEBUG org.apache.http.headers - http-outgoing-0 << HTTP/1.1 303 See Other
[main] DEBUG org.apache.http.headers - http-outgoing-0 << Date: Tue, 29 Oct 
2019 22:49:38 GMT
[main] DEBUG org.apache.http.headers - http-outgoing-0 << Location: 
/redirectRequest/foo/test-secured-put-resource
[main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Length: 0
[main] DEBUG org.apache.http.headers - http-outgoing-0 << Server: 
Jetty(9.2.24.v20180105)
[main] DEBUG org.apache.http.impl.execchain.MainClientExec - Connection can be 
kept alive indefinitely
[main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - 
Connection [id: 0][route: {}->http://localhost:61326] can be kept alive 
indefinitely
[main] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection - 
http-outgoing-0: set socket timeout to 0
[main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - 
Connection released: [id: 0][route: {}->http://localhost:61326][total kept 
alive: 1; route allocated: 1 of 20; total allocated: 1 of 40]
http://localhost:61326/test-secured-put-resource -- status code: 303, reason 
phrase: See Other
 Transfer error: null
Uploading: test-secured-put-resource to http://localhost:61326

[main] DEBUG org.apache.http.client.protocol.RequestAddCookies - CookieSpec 
selected: compatibility
[main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - 
Connection request: [route: {}->http://localhost:61326][total kept alive: 1; 
route allocated: 1 of 20; total allocated: 1 of 40]
[main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - 
Connection leased: [id: 0][route: {}->http://localhost:61326][total kept alive: 
0; route allocated: 1 of 20; total allocated: 1 of 40]
call count: 2
Right before read, dst remaining: 4096
 available: 0
Calling read(byte: [B@4fad9bb2, int: 0, int: 4096)
[main] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection - 
http-outgoing-0: set socket timeout to 0
[main] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection - 
http-outgoing-0: set socket timeout to 1800000
[main] DEBUG org.apache.http.impl.execchain.MainClientExec - Executing request 
PUT /redirectRequest/foo/test-secured-put-resource HTTP/1.1
[main] DEBUG org.apache.http.impl.execchain.MainClientExec - Target auth state: 
UNCHALLENGED
[main] DEBUG org.apache.http.impl.execchain.MainClientExec - Proxy auth state: 
UNCHALLENGED
[main] DEBUG org.apache.http.headers - http-outgoing-0 >> PUT 
/redirectRequest/foo/test-secured-put-resource HTTP/1.1
[main] DEBUG org.apache.http.headers - http-outgoing-0 >> Cache-control: 
no-cache
[main] DEBUG org.apache.http.headers - http-outgoing-0 >> Cache-store: no-store
[main] DEBUG org.apache.http.headers - http-outgoing-0 >> Pragma: no-cache
[main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Length: 14
[main] DEBUG org.apache.http.headers - http-outgoing-0 >> Host: localhost:61326
[main] DEBUG org.apache.http.headers - http-outgoing-0 >> Connection: Keep-Alive
[main] DEBUG org.apache.http.headers - http-outgoing-0 >> User-Agent: 
Apache-HttpClient/4.5.9 (Java/11.0.1)
[main] DEBUG org.apache.http.headers - http-outgoing-0 >> Accept-Encoding: 
gzip,deflate
[qtp989447607-30] WARN org.eclipse.jetty.server.HttpChannel - 
/redirectRequest/foo/test-secured-put-resource
java.io.IOException: java.util.concurrent.TimeoutException: Idle timeout 
expired: 30004/30000 ms
        at 
org.eclipse.jetty.util.SharedBlockingCallback$Blocker.block(SharedBlockingCallback.java:213)
        at 
org.eclipse.jetty.server.HttpInputOverHTTP.blockForContent(HttpInputOverHTTP.java:66)
        at 
org.eclipse.jetty.server.HttpInput$1.waitForContent(HttpInput.java:489)
        at org.eclipse.jetty.server.HttpInput.read(HttpInput.java:122)
        at java.base/java.io.InputStream.read(InputStream.java:205)
        at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:169)
        at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:156)
        at 
org.apache.maven.wagon.http.HttpWagonTestCase$PutHandler.handle(HttpWagonTestCase.java:2125)
        at 
org.apache.maven.wagon.http.HttpWagonTestCase$RedirectHandler.handle(HttpWagonTestCase.java:1205)
        at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
        at org.eclipse.jetty.server.Server.handle(Server.java:499)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
        at 
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:258)
        at 
org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
        at 
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
        at 
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.util.concurrent.TimeoutException: Idle timeout expired: 
30004/30000 ms
        at 
org.eclipse.jetty.io.IdleTimeout.checkIdleTimeout(IdleTimeout.java:161)
        at org.eclipse.jetty.io.IdleTimeout$1.run(IdleTimeout.java:50)
        at 
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at 
java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        ... 1 more
[main] DEBUG org.apache.http.headers - http-outgoing-0 << HTTP/1.1 500 
java.util.concurrent.TimeoutException: Idle timeout expired: 30004/30000 ms
[main] DEBUG org.apache.http.headers - http-outgoing-0 << Date: Tue, 29 Oct 
2019 22:49:38 GMT
[main] DEBUG org.apache.http.headers - http-outgoing-0 << Cache-Control: 
must-revalidate,no-cache,no-store
[main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Type: 
text/html; charset=ISO-8859-1
[main] DEBUG org.apache.http.headers - http-outgoing-0 << Content-Length: 389
[main] DEBUG org.apache.http.headers - http-outgoing-0 << Connection: close
[main] DEBUG org.apache.http.headers - http-outgoing-0 << Server: 
Jetty(9.2.24.v20180105)
http://localhost:61326//redirectRequest/foo/test-secured-put-resource -- status 
code: 500, reason phrase: java.util.concurrent.TimeoutException: Idle timeout 
expired: 30004/30000 ms
 Transfer error: org.apache.maven.wagon.TransferFailedException: Transfer 
failed for 
http://localhost:61326//redirectRequest/foo/test-secured-put-resource 500 
java.util.concurrent.TimeoutException: Idle timeout expired: 30004/30000 ms
[main] DEBUG org.apache.http.impl.conn.DefaultManagedHttpClientConnection - 
http-outgoing-0: Close connection
[main] DEBUG org.apache.http.impl.execchain.MainClientExec - Connection 
discarded
[main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - 
Connection released: [id: 0][route: {}->http://localhost:61326][total kept 
alive: 0; route allocated: 0 of 20; total allocated: 0 of 40]
http://localhost:61326 - Session: Disconnecting  
http://localhost:61326 - Session: Disconnected
[main] INFO org.eclipse.jetty.server.ServerConnector - Stopped 
ServerConnector@10aa41f2{HTTP/1.1}{0.0.0.0:0}
[main] INFO org.eclipse.jetty.server.ServerConnector - Stopped 
ServerConnector@5c90e579{HTTP/1.1}{0.0.0.0:0}
{noformat}

The BAOS is simply supposed to return -1 and not block. I assume that the 
channel does some magic and blocks for us. Suprisingly, when I run this code 
isolated in a main, it simply works.

I have wrapped the input steam in question with:

{code:java}
@Override
                public int read(byte[] b, int off, int len) throws IOException {
                        System.out.println(" available: " + in.available());
                        System.out.printf("Calling read(byte: %s, int: %d, int: 
%d)%n", b, off, len);

                        return in.read(b, off, len);
                }
{code}

Any ideas?

> Fail to deploy on Sonatype OSS since maven 3.5.4
> ------------------------------------------------
>
>                 Key: WAGON-568
>                 URL: https://issues.apache.org/jira/browse/WAGON-568
>             Project: Maven Wagon
>          Issue Type: Bug
>          Components: wagon-http
>    Affects Versions: 3.3.3
>         Environment: 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 
> PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64
> openjdk version "1.8.0_202"
> OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_202-b08)
> OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.202-b08, mixed mode)
>            Reporter: Stephane Landelle
>            Priority: Major
>
> I've been trying to release AsyncHttpClient for days and deployment was 
> always super slow until it ultimately failed or completely stalled.
> The issue seems to be that maven-deploy-plugin wants to upload checksum 
> files. I have no idea where those would come from, as far as I know, those 
> are generated by the maven repository.
>  
> {code:java}
> [INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) @ 
> async-http-client-project ---
> Uploading to sonatype-nexus-staging: 
> http://oss.sonatype.org/service/local/staging/deploy/maven2/org/asynchttpclient/async-http-client-project/2.0.40/async-http-client-project-2.0.40.pom
> [WARNING] Failed to upload checksum 
> org/asynchttpclient/async-http-client-project/2.0.40/async-http-client-project-2.0.40.pom.sha1:
>  null{code}
>  
>  
> For each actual file, maven-deploy-plugin tries to upload a sha1 and a md5 
> files and this takes forever to ultimately fail.
> I tried upgrading plugins but nothing worked.
> I finally found [this 
> ticket|[https://issues.sonatype.org/browse/OSSRH-43371?focusedCommentId=610865&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-610865]]
>  against Sonatype OSS describing the exact same behavior and stating 
> downgrading to maven 3.5.3 fixed the issue.
> Indeed, downgrading did the trick!
> I'm opening an issue here and not against OSS Sonatype as it looks like a 
> maven regression to me.
>  * maven 3.6.2: fails
>  * maven 3.5.4: fails
>  * maven 3.5.3: works like a charm



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to