Skip to content

Commit

Permalink
fix: remove potential infinite loop in administrative requests (#398)
Browse files Browse the repository at this point in the history
The automatic retryer for non-idempotent administrative requests did not keep
track of the nextPageToken correctly when querying the backend for running
operations. This could cause an infinite loop if a resource (database/backup)
with the same name had been created repeatedly on the same instance.
  • Loading branch information
olavloite committed Aug 27, 2020
1 parent 52fc363 commit 81d2c76
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -575,6 +575,7 @@ private Operation mostRecentOperation(
Paginated<Operation> operations;
do {
operations = lister.listOperations(nextPageToken);
nextPageToken = operations.getNextPageToken();
for (Operation op : operations.getResults()) {
Timestamp startTime = getStartTimeFunction.apply(op);
if (res == null
Expand All @@ -590,7 +591,7 @@ private Operation mostRecentOperation(
break;
}
}
} while (operations.getNextPageToken() != null);
} while (nextPageToken != null);
return res;
}

Expand Down

0 comments on commit 81d2c76

Please sign in to comment.