Add retry logic for bad gateway response errors#149
Merged
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #149 +/- ##
==========================================
+ Coverage 94.00% 94.04% +0.04%
==========================================
Files 6 6
Lines 584 588 +4
Branches 30 31 +1
==========================================
+ Hits 549 553 +4
Misses 27 27
Partials 8 8 ☔ View full report in Codecov by Sentry. |
Merged
miaucl
approved these changes
Feb 8, 2025
Owner
|
Wow good research, lets hope it helps!👍 |
tr4nt0r
added a commit
that referenced
this pull request
Mar 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bring are using AWS Elastic Load Balancer to distribute the load to the Bring servers. Sporadically they respond with a 502 bad gateway error. My research for the cause of this error has shown that the cause may be a misconfiguration of their servers. The keep-alive of the API servers is shorter than the keep-alive of the load balancers, which is causing the load balancers not being able route the request because the connection was already closed.
See - kubernetes-sigs/aws-load-balancer-controller#2272 (comment)
I can't fix that as it is outside of my control, but I can add a retry logic for this error.
The retry will be happen after 502, 503 and 504 status after waiting randomly for 1 ms to 5 s