scwhittle commented on code in PR #25186:
URL: https://github.com/apache/beam/pull/25186#discussion_r1098681684
##########
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/logging/BeamFnLoggingClient.java:
##########
@@ -287,9 +284,24 @@ public void run() {
outboundObserver.onError(
Status.INTERNAL.withDescription(getStackTraceAsString(thrown)).asException());
throw new IllegalStateException(thrown);
- } else {
- outboundObserver.onCompleted();
}
+ if (inboundObserverCompletion.isDone()) {
+ try {
+ inboundObserverCompletion.get();
+ throw new IllegalStateException(
+ "Logging stream terminated unexpectedly with success before it
was closed by the client.");
+ } catch (ExecutionException e) {
+ throw new IllegalStateException(
+ "Logging stream terminated unexpectedly before it was closed by
the client with error: "
+ + e.getCause());
+ } catch (InterruptedException e) {
+ // Should never happen because of the isDone check.
+ Thread.currentThread().interrupt();
+ throw new RuntimeException(e);
+ }
+ }
+
+ outboundObserver.onCompleted();
Review Comment:
Can you clarify? The only onError is followed by throwing an exception, is
there something else I'm missing?
--
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]