[
https://issues.apache.org/jira/browse/HTTPCLIENT-2407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18046880#comment-18046880
]
Oleg Kalnichevski commented on HTTPCLIENT-2407:
-----------------------------------------------
[~nicolasm35] I also took another look at the section of 9 of RFC 9112 and
section 9.6. "Tear-down" in particular. While the spec is pretty clear that the
client must stop sending _requests_ on a connection explicitly marked as being
closed by the server, it says nothing about aborting an ongoing request in
response to a non-error status code.
For now I will take no action and will leave everything as is, though, I do
admit that sending the entire request body in response to a redirect with
"connection: close" is pointless.
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
> Attachments: image-2025-12-19-17-21-47-782.png,
> image-2025-12-19-17-22-00-608.png, log-http5.txt
>
>
> 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]