Skip to content

Change ConnectTransportException response code to 502 #118320

@DaveCTurner

Description

@DaveCTurner

According to RFC 9110 § 15.6.3, the 502 Bad Gateway response code is appropriate whenever:

the server, while acting as a gateway or proxy, received an invalid response from an inbound server it accessed while attempting to fulfill the request.

These days we consider the ES REST to be acting as a gateway to the cluster (or clusters) being accessed, so that seems like a more appropriate code to use when returning a ConnectTransportException than today’s 500. More practically, our clients generally retry on a 502, but not on a 500, and retrying on a ConnectTransportException seems like the right thing to do.

Relates ES-10214

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions