[
https://issues.apache.org/jira/browse/HTTPCLIENT-2407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18042823#comment-18042823
]
Oleg Kalnichevski commented on HTTPCLIENT-2407:
-----------------------------------------------
> java.net.SocketException: Broken pipe
[~nicolasm35] I am not entirely sure what it is exactly you expect us to do?
Cast a curse on the server? Because clearly the connection gets dropped by the
opposite endpoint.
HttpClient does not impose any limit on message content bodies inbound or
outbound (with one notable exception of MIME coded content).
What you could try to do is to produce a complete wire / context log with
HttpClient 4 and HttpClient and compare the logs. One possibility that the
target server or whatever intermediary there may be in between gets upset by
the expect-continue handshake that HC4 does not activate by default and HC5
does.
Oleg
> Unable to send string entity with more than 100000 bytes
> --------------------------------------------------------
>
> Key: HTTPCLIENT-2407
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2407
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient (classic)
> Affects Versions: 5.5.1
> Reporter: Nicolas Melo
> Priority: Major
>
> I was using httpclient4 (4.5.14) to send a String entity to Starrocks
> following example here:
> [https://github.com/StarRocks/demo/blob/master/MiscDemo/stream_load/java/StarRocksStreamLoad.java#L128]
> I have tried to upgrade to httpclient5 but it fails when String entity is
> larger than 100000 bytes.
> I don't understand where this limit comes from. It is not an issue on server
> side as it is working perfectly well with http4 lib.
> Here is the stack trace:
> {code:java}
> java.net.SocketException: Broken pipe
> at java.base/sun.nio.ch.SocketDispatcher.write0(Native Method)
> at java.base/sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:62)
> at java.base/sun.nio.ch.NioSocketImpl.tryWrite(NioSocketImpl.java:394)
> at java.base/sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:413)
> at java.base/sun.nio.ch.NioSocketImpl.write(NioSocketImpl.java:440)
> at java.base/sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:819)
> at java.base/java.net.Socket$SocketOutputStream.write(Socket.java:1195)
> at
> org.apache.hc.client5.http.impl.io.LoggingOutputStream.write(LoggingOutputStream.java:72)
> at
> org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection$1.write(DefaultBHttpClientConnection.java:259)
> at
> org.apache.hc.core5.http.impl.io.SessionOutputBufferImpl.write(SessionOutputBufferImpl.java:143)
> at
> org.apache.hc.core5.http.impl.io.ContentLengthOutputStream.write(ContentLengthOutputStream.java:112)
> at
> org.apache.hc.core5.http.impl.io.ContentLengthOutputStream.write(ContentLengthOutputStream.java:119)
> at
> org.apache.hc.core5.http.io.entity.StringEntity.writeTo(StringEntity.java:188)
> at
> org.apache.hc.core5.http.impl.io.DefaultBHttpClientConnection.sendRequestEntity(DefaultBHttpClientConnection.java:285)
> at
> org.apache.hc.core5.http.impl.io.HttpRequestExecutor.execute(HttpRequestExecutor.java:188)
> at
> org.apache.hc.client5.http.impl.classic.InternalExecRuntime.lambda$execute$0(InternalExecRuntime.java:236)
> at
> org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager$InternalConnectionEndpoint.execute(PoolingHttpClientConnectionManager.java:798)
> at
> org.apache.hc.client5.http.impl.classic.InternalExecRuntime.execute(InternalExecRuntime.java:233)
> at
> org.apache.hc.client5.http.impl.classic.MainClientExec.execute(MainClientExec.java:120)
> at
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
> at
> org.apache.hc.client5.http.impl.classic.ConnectExec.execute(ConnectExec.java:200)
> at
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
> at
> org.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ProtocolExec.java:195)
> at
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
> at
> org.apache.hc.client5.http.impl.classic.ContentCompressionExec.execute(ContentCompressionExec.java:151)
> at
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
> at
> org.apache.hc.client5.http.impl.classic.HttpRequestRetryExec.execute(HttpRequestRetryExec.java:112)
> at
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
> at
> org.apache.hc.client5.http.impl.classic.RedirectExec.execute(RedirectExec.java:110)
> at
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
> at
> org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:185)
> at
> org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:245)
> at
> org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:188)
> {code}
> Thanks for your help!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]