-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retry quay.io request on 520 responses #5
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Mit ein paar Kommentaren zurück. Sonst sieht das aber gut aus finde ich.
accept: :json) | ||
rescue RestClient::ExceptionWithResponse => err | ||
return nil if err.http_code == 404 # ignore unknown repos | ||
if err.http_code == 520 and attempt < MAX_ATTEMPTS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warum versucht ihr es nur bei 520? Das ist ja sogar ein Spezialfall von Cloudflare. Warum nehmt ihr nicht einfach alle 500?
if err.http_code == 520 and attempt < MAX_ATTEMPTS | |
if err.http_code >= 500 and attempt < MAX_ATTEMPTS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, gute Frage, ich bin unentschlossen. Uns nervt gerade der 520, weil wir wissen, dass das ein temporäres Problem ist und das weggeht, wenn zu einem späteren Zeitpunkt ein erneuter Request kommt. Andere 500 haben wir nicht gesehen und wir wissen auch nicht, wie dann die Situation aussieht. Daher würde ich für den Moment abwarten, bis wir in eine solche Situation kommen und dann bewerten, ob wir alle 500 abfangen.
rescue RestClient::ExceptionWithResponse => err | ||
return nil if err.http_code == 404 # ignore unknown repos | ||
if err.http_code == 520 and attempt < MAX_ATTEMPTS | ||
sleep(rand(10)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warum hier ein Zufall beim warten auf den nächsten Versuch? Ich kenne sonst das Pattern, dass mit jedem weiteren Versuch länger gewartet wird (als Optimierung der Gesamtwartezeit). Ich würde daher schreiben
sleep(rand(10)) | |
sleep(attempt ** 2) |
Das **
steht für Potenz.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Das Problem scheint daher zu kommen, dass bei einem Check-Request alle Docker-Nodes gleichzeitig zu quay.io rennen. Das würde sich nicht ändern, wenn alle Nodes deterministisch warten, um dann erneut gleichzeitig bei quay.io anzufragen. Ich will hier bewusst für eine zufällige zeitliche Streuung der Requests über die einzelnen Nodes sorgen.
No description provided.