Skip to content

Commit

Permalink
Fix divide by zero in LoadBalancingKMSClientProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
yiyuaner committed May 25, 2021
1 parent 028ec47 commit f554b83
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ private <T> T doOp(ProviderCallable<T> op, int currPos,
}

private int nextIdx() {
if (providers.length == 0) {
throw new IOException("No providers configured !");
}

while (true) {
int current = currentIdx.get();
int next = (current + 1) % providers.length;
Expand Down

0 comments on commit f554b83

Please sign in to comment.