Skip to content

Commit

Permalink
fix: using context from call in ReadRowsRetryingCallable (googleapis#…
Browse files Browse the repository at this point in the history
  • Loading branch information
isha97 authored and yifatgortler committed Jul 25, 2024
1 parent 167f9ec commit 4dd8100
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,16 @@ public void call(
ReadRowsRequest request,
final ResponseObserver<ReadRowsResponse> responseObserver,
ApiCallContext context) {
ApiCallContext actualContext = this.context.merge(context);
ReadRowsAttemptCallable attemptCallable =
new ReadRowsAttemptCallable(
innerCallable,
resumptionStrategyPrototype.createNew(),
request,
this.context,
actualContext,
responseObserver);

RetryingFuture<Void> retryingFuture = executor.createFuture(attemptCallable, this.context);
RetryingFuture<Void> retryingFuture = executor.createFuture(attemptCallable, actualContext);
attemptCallable.setExternalFuture(retryingFuture);
attemptCallable.start();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,16 @@ public void call(
ReadRowsRequest request,
final ResponseObserver<ReadRowsResponse> responseObserver,
ApiCallContext context) {
ApiCallContext actualContext = this.context.merge(context);
ReadRowsAttemptCallable attemptCallable =
new ReadRowsAttemptCallable(
innerCallable,
resumptionStrategyPrototype.createNew(),
request,
this.context,
actualContext,
responseObserver);

RetryingFuture<Void> retryingFuture = executor.createFuture(attemptCallable, this.context);
RetryingFuture<Void> retryingFuture = executor.createFuture(attemptCallable, actualContext);
attemptCallable.setExternalFuture(retryingFuture);
attemptCallable.start();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,16 @@ public void call(
ReadRowsRequest request,
final ResponseObserver<ReadRowsResponse> responseObserver,
ApiCallContext context) {
ApiCallContext actualContext = this.context.merge(context);
ReadRowsAttemptCallable attemptCallable =
new ReadRowsAttemptCallable(
innerCallable,
resumptionStrategyPrototype.createNew(),
request,
this.context,
actualContext,
responseObserver);

RetryingFuture<Void> retryingFuture = executor.createFuture(attemptCallable, this.context);
RetryingFuture<Void> retryingFuture = executor.createFuture(attemptCallable, actualContext);
attemptCallable.setExternalFuture(retryingFuture);
attemptCallable.start();

Expand Down

0 comments on commit 4dd8100

Please sign in to comment.