Skip to content

more granular 5xx retry policy #2300

@ikruglov

Description

@ikruglov

(cross-posting from envoy-users for tracking an issue)

What do you guys think about having more granular retry policy rather than just 5xx?

The motivation behind this post is that:

  1. we use nginx + uwsgi at $work.
  2. setting 5xx as default retry policy is not safe due to possible non-idempotent requests: did data arrive on the server? did server process them?
  3. however, in our setup, 502 errors are common: nginx failed to talk to uwsgi for whatever reason. Retry is safe, no data hit uwsgi. Same for 503 btw.

Basically, what I'm trying to achieve is to provide safe default retry policy for my users which would be: "connect-failure" + 502 + 503.

I see that envoy's code base has:

static bool isGatewayError(uint64_t code) { return code >= 502 && code < 505; }

which made me think about having retry policy: "gateway_error". This policy would cover my needs but as a downside includes 504 which is redundant.

Alternatively, maybe explicitly enumerating HTTP response codes? retry_on=connect_failure,502,503

Metadata

Metadata

Assignees

No one assigned

    Labels

    beginnerGood starter issues!enhancementFeature requests. Not bugs or questions.help wantedNeeds help!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions