Skip to content

Large Content-Length response truncated at a random offset through an HTTPS listener with h2 in ALPN (HTTP/1.1 client) #1906

Closed

Description

@FlorentinDUBOIS

Summary

A large Content-Length response streamed through a Sōzu HTTPS listener with alpn_protocols = ["h2", "http/1.1"] is cut before the end of its body. The cut lands at a different offset on each attempt. Moving the same domain to a Sōzu listener without H2 makes the transfer complete.

Observed

  • Client: Sonatype Nexus 3.72 acting as a proxy repository. Its outbound client is Apache HttpClient 4, so the client→Sōzu leg is HTTP/1.1.
  • Object: a 9,141,810,688-byte file, Content-Length framed, served by a JVM HTTP/1.1 backend that fronts S3-compatible storage.
  • Client error: org.apache.http.ConnectionClosedException: Premature end of Content-Length delimited message body (expected: 9,141,810,688; received: 386,808,552).
  • The amount received before the cut varies from attempt to attempt. An earlier occurrence on the same load balancers, downloading from the same Nexus, showed the same random-size truncation.
  • Workaround: pointing the backend's domain to another Sōzu deployment that does not negotiate H2 fixes the transfer. The backend JVM was also restarted at the same time.

Environment

  • Sōzu version on the failing listener: 2.2.1
  • Sōzu version and ALPN on the working listener: '2.2.1 & h2, http/1.1'
  • Listener ALPN on the failing side: h2, http/1.1 (default of our deployment role)

Not yet established

  • Which side closes first, Sōzu→client or Sōzu→backend. We do not yet have the Sōzu access log line or the error log for the request.
  • Whether the truncation needs an H2 session on the same listener, or whether it happens for any HTTP/1.1 stream handled by the 2.x mux.
  • Possibly related, but distinct: mux: a Content-Length response truncated by a backend close is forwarded as complete #1633, which covers the reverse case, where a body truncated by the backend was forwarded as complete.

Next data to collect

  • Sōzu logs filtered on the request id, plus the h2.goaway.*, h2.flood.violation.* and h2.streams.reaped.* metrics at the time of the cut.
  • A reproduction with curl --http1.1 through the failing listener, recording the bytes and seconds at the cut, to tell a size limit from a time limit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions