Skip to content

Commit aff0bec

Browse files
werktcopybara-github
authored andcommitted
Operation stream termination is not an error
According to the GrpcRemoteExecutor when it occurs after a !done operation response. Remove the error from the ExperimentalRemoteGrpcExecutor and reinforce both with tests. Update the FakeExecutionService to generate compatible error responses that appear in the ExecuteResponse, rather than the operation error field, per the REAPI spec. Made required adjustments to ExGRE Test invocations to avoid the ExecutionStatusException interpretation of DEADLINE_EXCEEDED -> FAILED_PRECONDITION in ExecuteResponse. Closes #18785. PiperOrigin-RevId: 546925894 Change-Id: I7a489c8bc936a83cfd94e0138437f3fe6d152da8
1 parent 2c16f3f commit aff0bec

5 files changed

Lines changed: 473 additions & 289 deletions

File tree

src/main/java/com/google/devtools/build/lib/remote/ExperimentalGrpcRemoteExecutor.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,12 @@ ExecuteResponse start() throws IOException, InterruptedException {
146146
// retrying when received a unauthenticated error, and propagate to refreshIfUnauthenticated
147147
// which will then call retrier again. It will reset the retry time counter so we could
148148
// retry more than --remote_retry times which is not expected.
149-
response =
150-
retrier.execute(
151-
() -> Utils.refreshIfUnauthenticated(this::execute, callCredentialsProvider),
152-
executeBackoff);
149+
if (lastOperation == null) {
150+
response =
151+
retrier.execute(
152+
() -> Utils.refreshIfUnauthenticated(this::execute, callCredentialsProvider),
153+
executeBackoff);
154+
}
153155

154156
// If no response from Execute(), use WaitExecution() in a "loop" which is implemented
155157
// inside the retry block.
@@ -216,6 +218,7 @@ ExecuteResponse waitExecution() throws IOException {
216218
}
217219

218220
/** Process a stream of operations from Execute() or WaitExecution(). */
221+
@Nullable
219222
ExecuteResponse handleOperationStream(Iterator<Operation> operationStream) throws IOException {
220223
try {
221224
while (operationStream.hasNext()) {
@@ -258,8 +261,8 @@ ExecuteResponse handleOperationStream(Iterator<Operation> operationStream) throw
258261
}
259262
}
260263

261-
// The operation completed successfully but without a result.
262-
throw new IOException("Remote server error: execution terminated with no result");
264+
// The operation stream completed successfully but without a result.
265+
return null;
263266
} finally {
264267
close(operationStream);
265268
}

0 commit comments

Comments
 (0)