diff --git a/duo-client/src/main/java/com/duosecurity/client/Http.java b/duo-client/src/main/java/com/duosecurity/client/Http.java index fadb3fa..7b3b7e6 100644 --- a/duo-client/src/main/java/com/duosecurity/client/Http.java +++ b/duo-client/src/main/java/com/duosecurity/client/Http.java @@ -318,6 +318,10 @@ private Response executeRequest(Request request) throws Exception { return response; } + // Close the 429 response to release the connection back to the pool before retrying + if (response.body() != null) { + response.close(); + } sleep(backoffMs + nextRandomInt(1000)); backoffMs *= BACKOFF_FACTOR; }