Skip to content

Commit

Permalink
Add GOAWAY handling
Browse files Browse the repository at this point in the history
  • Loading branch information
shartte committed May 25, 2024
1 parent 51af754 commit cef09b8
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,13 @@ public boolean download(DownloadSpec spec, Path finalLocation, boolean silent) t
try {
response = httpClient.send(request, HttpResponse.BodyHandlers.ofFile(partialFile));
} catch (IOException e) {
// We do not have an API to get this information
if ("too many concurrent streams".equals(e.getMessage())) {
// We do not have an API to get this limit from the connection and just retry :(
waitForRetry(1);
continue;
} else if (e.getMessage() != null && e.getMessage().endsWith(" GOAWAY received")) {
// Retry this immediately, since it usually indicates we've reached max requests per connection
continue;
}
throw e;
} catch (InterruptedException e) {
Expand Down

0 comments on commit cef09b8

Please sign in to comment.