Skip to content

8.22.0 regression: CURLE_SEND_ERROR when reusing an HTTP/2 connection the server closed less than 1 s earlier #23621

Closed

Description

@plv1313

I did this

After upgrading libcurl 8.21.0 to 8.22.0, transfers over HTTP/2 (multi interface, one connection per host, multiplexing) intermittently fail with CURLE_SEND_ERROR (55) and no response, e.g.:

Failed sending data to the peer (55): OpenSSL SSL_read: OpenSSL/3.6.3: error:0A000126:SSL routines::unexpected eof while reading, errno 0
Failed sending data to the peer (55): OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 0
Failed sending data to the peer (55): Send failure: Broken pipe

Likely cause:

#22169 ("connection alive checks intervals"): Curl_cpool_conn_seems_healthy() skips the liveness probe when the connection was checked less than 1000 ms ago:

if(curlx_ptimediff_ms(pnow, &conn->lastchecked) < 1000)
  return TRUE;

and lastchecked is set in Curl_cpool_conn_now_idle(), when the connection's last transfer finishes. So a connection the server closed within that second is reused without a probe, and the new transfers fail. In 8.21.0 picking an idle connection always ran Curl_conn_seems_dead(), which discarded it.

Waiting 1.5 s before the next transfers makes 8.22.0 succeed, consistent with this.

I expected the following

as with 8.21.0, a transfer should never fail because the pooled connection it picked was already closed by the server. curl should detect the closed connection before reusing it, or retry the transfer on a fresh connection when it fails before any response data arrived.

curl/libcurl version

libcurl 8.22.0
8.21.0 not affected

operating system

linux x86_64

Activity

  1. bagder commented on Oct 27, 2026

    @bagder
    Member

    a transfer should never fail because the pooled connection it picked was already closed by the server

    "Never" is hard to live up to.

  2. icing commented on Oct 28, 2026

    @icing
    Contributor

    @plv1313 please have a look at #23647 which always checks now when an idle connection is picked up.

    As to "never": the server's GOAWAY or connection close might arrive a nanosecond after the check...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions