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

ASF GitHub Bot commented on GROOVY-12287:
-----------------------------------------

codecov-commenter commented on PR #2824:
URL: https://github.com/apache/groovy/pull/2824#issuecomment-5380699698

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2824?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 Report
   :x: Patch coverage is `55.55556%` with `16 lines` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 70.2620%. Comparing base 
([`01f91d4`](https://app.codecov.io/gh/apache/groovy/commit/01f91d475918156df6c290460c70e3c7dfbe1e36?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`c29289a`](https://app.codecov.io/gh/apache/groovy/commit/c29289a16eaa199f845f90893e809ebcd5d07c5d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2824?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[...der/src/main/groovy/groovy/http/HttpBuilder.groovy](https://app.codecov.io/gh/apache/groovy/pull/2824?src=pr&el=tree&filepath=subprojects%2Fgroovy-http-builder%2Fsrc%2Fmain%2Fgroovy%2Fgroovy%2Fhttp%2FHttpBuilder.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LWh0dHAtYnVpbGRlci9zcmMvbWFpbi9ncm9vdnkvZ3Jvb3Z5L2h0dHAvSHR0cEJ1aWxkZXIuZ3Jvb3Z5)
 | 55.5556% | [6 Missing and 10 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2824?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/2824/graphs/tree.svg?width=650&height=150&src=pr&token=1r45138NfQ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/groovy/pull/2824?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #2824        +/-   ##
   ==================================================
   + Coverage     70.2594%   70.2620%   +0.0026%     
   - Complexity      36274      36291        +17     
   ==================================================
     Files            1569       1569                
     Lines          133723     133755        +32     
     Branches        24637      24650        +13     
   ==================================================
   + Hits            93953      93979        +26     
   + Misses          31257      31255         -2     
   - Partials         8513       8521         +8     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2824?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...der/src/main/groovy/groovy/http/HttpBuilder.groovy](https://app.codecov.io/gh/apache/groovy/pull/2824?src=pr&el=tree&filepath=subprojects%2Fgroovy-http-builder%2Fsrc%2Fmain%2Fgroovy%2Fgroovy%2Fhttp%2FHttpBuilder.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LWh0dHAtYnVpbGRlci9zcmMvbWFpbi9ncm9vdnkvZ3Jvb3Z5L2h0dHAvSHR0cEJ1aWxkZXIuZ3Jvb3Z5)
 | `74.3506% <55.5556%> (-2.4609%)` | :arrow_down: |
   
   ... and [8 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/2824/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test 
Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, 
report on failures, and find test suite problems.
   - :package: [JS Bundle 
Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save 
yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>




> HttpBuilder: retry once on a stale keep-alive connection
> --------------------------------------------------------
>
>                 Key: GROOVY-12287
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12287
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Daniel Sun
>            Priority: Major
>
> HttpBuilder follows redirects itself whenever {{followRedirects}} is enabled. 
> The next hop goes through the same JDK {{HttpClient}} and may reuse a 
> keep-alive connection the peer has already closed.
> JDK {{HttpClient}} retries that failure for GET/HEAD, but not for 
> PUT/POST/PATCH. A same-origin 301 of a PUT then fails intermittently:
> {noformat}
> java.lang.RuntimeException: I/O error during HTTP request PUT 
> http://127.0.0.1:.../api/put-dst
> Caused by: java.io.IOException: HTTP/1.1 header parser received no bytes
> Caused by: java.io.IOException: Broken pipe
> {noformat}
> Seen on 
> {{HttpBuilderTest.confineToBaseUriPreservesNonPostMethodAcrossRedirectOn301}} 
> (GROOVY-12182). Redirect following is always manual (GROOVY-12274). GET 
> follow-ups do not flake: the JDK client retries them.
> h2. Cause
> A common trigger is {{com.sun.net.httpserver.HttpServer}}: 
> {{sendResponseHeaders(status, -1)}} closes the exchange immediately. If the 
> request body was never read, that close drops the TCP connection *without* 
> sending {{Connection: close}}. The client pools the socket, reuses it for the 
> next hop, and PUT is not retried.
> The same class of failure happens against any HTTP/1.1 peer that silently 
> drops a keep-alive connection (idle timeout, 3xx of a request with a body, 
> etc.).
> h2. Expected
> With {{followRedirects true}}, a PUT that receives 301 should reach the 
> {{Location}} target with method and body preserved 
> ({{HttpClient.Redirect.NORMAL}}).
> h2. Actual
> The follow-up PUT occasionally throws the I/O error above before any response 
> bytes are read.
> h2. Fix
> # Retry *once* in {{HttpBuilder.send}} / {{sendAsync}} when the I/O error 
> indicates a stale connection ({{header parser received no bytes}}, broken 
> pipe, connection reset). Do not retry timeouts or interrupts.
> # Drain the request body in test {{HttpServer}} redirect handlers *before* 
> {{sendResponseHeaders(status, -1)}}, so the mock server does not drop the 
> socket without advertising it.
> Regression: {{HttpBuilderStaleConnectionTest}} (peer consumes the request and 
> closes with no response; PUT and {{putAsync}} recover on the second 
> connection).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to