Skip to content

Commit 9d028b0

Browse files
committed
Move reqId attempt increase out of runWithRetries
1 parent e05a375 commit 9d028b0

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionImpl.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,6 @@ public CommitResponse writeAtLeastOnceWithOptions(
305305
try (IScope s = tracer.withSpan(span)) {
306306
return SpannerRetryHelper.runTxWithRetriesOnAborted(
307307
() -> {
308-
// TODO(@odeke-em): Only increment on UNAVAILABLE and INCREMENT,
309-
// instead increment the nthRequest on ABORTED and others.
310-
reqId.incrementAttempt();
311308
return new CommitResponse(
312309
spanner.getRpc().commit(request, reqId.withOptions(getOptions())));
313310
});
@@ -322,7 +319,7 @@ public CommitResponse writeAtLeastOnceWithOptions(
322319
private XGoogSpannerRequestId reqIdOrFresh(Options options) {
323320
XGoogSpannerRequestId reqId = options.reqId();
324321
if (reqId == null) {
325-
reqId = this.getRequestIdCreator().nextRequestId(1 /* TODO: channelId */, 0);
322+
reqId = this.getRequestIdCreator().nextRequestId(1 /* TODO: channelId */, 1);
326323
}
327324
return reqId;
328325
}

0 commit comments

Comments
 (0)