Skip to content
Permalink
Browse files
fix: remove potential infinite loop in administrative requests (#398)
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 81d2c7634edd30efd428846fdbc468aee5406ed5
Showing with 2 additions and 1 deletion.
  1. +2 −1 google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java
@@ -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
@@ -590,7 +591,7 @@ private Operation mostRecentOperation(
break;
}
}
} while (operations.getNextPageToken() != null);
} while (nextPageToken != null);
return res;
}

0 comments on commit 81d2c76

Please sign in to comment.