connection_closed_before_response

reactor.netty.http.client.PrematureCloseException: Connection prematurely closed BEFORE response
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:

img.png

desc:

PrematureCloseException caused by :

  • customer request with header: connection:close
  • gateway send all customer request headers to endpoint , so include connection:close
  • endpoint response without connection header, so release TCP to pool connect instead of close. but endpoint closed the TCP connection

fix:

when request endpoint, don’t include customer’s connection header, proxy or gateway set keep-alive .

ref: https://tools.ietf.org/html/rfc7230#section-6

The “Connection” header field allows the sender to indicate desired
control options for the current connection. In order to avoid
confusing downstream recipients, a proxy or gateway MUST remove or
replace any received connection options before forwarding the
message.

参考文章

评论