Abacn commented on code in PR #39367:
URL: https://github.com/apache/beam/pull/39367#discussion_r3882500503
##########
runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/artifact/ArtifactStagingService.java:
##########
@@ -433,6 +455,14 @@ public synchronized void
onNext(ArtifactApi.ArtifactResponseWrapper responseWrap
}
}
+ private void putChunk(ByteString chunk) throws Exception {
Review Comment:
Is this overly defensive? Local testing shows reverting back to
`currentOutput.put` call is fine.
Since this is a common code path, I'd prefer to stay minimum required change
##########
runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/artifact/ArtifactStagingService.java:
##########
@@ -421,8 +429,16 @@ public synchronized void
onNext(ArtifactApi.ArtifactResponseWrapper responseWrap
}
}
} catch (Exception exn) {
- LOG.error("Error submitting.", exn);
- onError(exn);
+ // The write of a previous chunk failed; surface the failure to
the client rather
+ // than leaving the stream unterminated, which would make the
client block forever.
+ LOG.error("Error staging artifacts", exn);
+ state = State.ERROR;
+ stagingExecutor.shutdownNow();
Review Comment:
Why remove the existing `onError(exn)` call and copy-paste nearly identical
codes here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]