shunping commented on code in PR #39115:
URL: https://github.com/apache/beam/pull/39115#discussion_r3476903274
##########
runners/direct-java/src/main/java/org/apache/beam/runners/direct/ExecutorServiceParallelExecutor.java:
##########
@@ -348,17 +348,23 @@ private void shutdownIfNecessary(State newState) {
} catch (final Exception e) {
errors.add(e);
}
- pipelineState.compareAndSet(State.RUNNING, newState); // ensure we hit a
terminal node
- if (!errors.isEmpty()) {
- final IllegalStateException exception =
- new IllegalStateException(
- "Error"
- + (errors.size() == 1 ? "" : "s")
- + " during executor shutdown:\n"
- + errors.stream()
- .map(Exception::getMessage)
- .collect(Collectors.joining("\n- ", "- ", "")));
- visibleUpdates.failed(exception);
+ IllegalStateException exception = null;
+ try {
+ if (!errors.isEmpty()) {
+ exception =
+ new IllegalStateException(
+ "Error"
+ + (errors.size() == 1 ? "" : "s")
+ + " occurred during pipeline execution:\\n"
+ + errors.stream()
+ .map(e -> e.getMessage() == null ?
e.getClass().getName() : e.getMessage())
+ .collect(Collectors.joining("\\n- ", "- ", "")));
Review Comment:
ack
--
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]