Skip to content

Retry request 3 times when API returns 5xx HTTP status#78

Merged
ArturT merged 4 commits intomasterfrom
retry-request-when-server-error
Mar 23, 2019
Merged

Retry request 3 times when API returns 5xx HTTP status#78
ArturT merged 4 commits intomasterfrom
retry-request-when-server-error

Conversation

@ArturT
Copy link
Copy Markdown
Member

@ArturT ArturT commented Mar 23, 2019

Before

When API returns 5xx error we don't retry the request.
Because of that, we run tests in Fallback Mode right away when nginx returns 502 error when could not connect to unicorn process on API side.

After this change

Retry request 3 times. If all 3 requests fail then start Fallback Mode.

Thanks to this change during API traffic peak time the Fallback Mode will be started only when it actually needs to.

ArturT added 3 commits March 23, 2019 14:04
* X-Request-Id is set by Knapsack Pro API rails app
* nginx returns 502 when request never touched unicorn due to busy
unicorn then X-Request-Id is empty
@ArturT ArturT merged commit 739137e into master Mar 23, 2019
@ArturT ArturT deleted the retry-request-when-server-error branch March 23, 2019 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant