Skip to content

Commit

Permalink
[Compression][Upload] Seek before jumping in rpc call
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessandroPatti committed Oct 13, 2021
1 parent 96e517a commit 04e4813
Showing 1 changed file with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,16 @@ ListenableFuture<Void> start() {
() ->
retrier.executeAsync(
() -> {
chunker.seek(committedOffset.get());
try {
chunker.seek(committedOffset.get());
} catch (IOException e) {
try {
chunker.reset();
} catch (IOException resetException) {
e.addSuppressed(resetException);
}
return Futures.immediateFailedFuture(e);
}
if (chunker.hasNext()) {
return callAndQueryOnFailure(committedOffset, progressiveBackoff);
}
Expand Down Expand Up @@ -521,17 +530,6 @@ private ListenableFuture<Void> call(AtomicLong committedOffset) {
.withDeadlineAfter(callTimeoutSecs, SECONDS);
call = channel.newCall(ByteStreamGrpc.getWriteMethod(), callOptions);

try {
chunker.seek(committedOffset.get());
} catch (IOException e) {
try {
chunker.reset();
} catch (IOException resetException) {
e.addSuppressed(resetException);
}
return Futures.immediateFailedFuture(e);
}

SettableFuture<Void> uploadResult = SettableFuture.create();
ClientCall.Listener<WriteResponse> callListener =
new ClientCall.Listener<WriteResponse>() {
Expand Down

0 comments on commit 04e4813

Please sign in to comment.