github-actions[bot] commented on code in PR #40721:
URL: https://github.com/apache/beam/pull/40721#discussion_r4346258742
##########
runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/control/SdkHarnessClient.java:
##########
@@ -546,6 +578,15 @@ public void close() throws Exception {
exception.addSuppressed(e);
}
}
+ // After the response, so that a failed bundle reports the SDK's error
rather than the
+ // cancelled queue it caused.
+ if (drainException != null) {
Review Comment:
**🟢 Low**: If `inboundObserver.awaitCompletion()` fails (e.g., a downstream
output receiver throws an exception or the data stream closes prematurely)
while the SDK's `ProcessBundleResponse` completes normally, `drainException` is
non-null but `exception` remains `null` during the `MoreFutures.get(response)`
block above (lines 556–567). As a result, `progressHandler.onCompleted`,
`checkpointHandler.onCheckpoint`, and
`finalizationHandler.requestsFinalization` will still be invoked before
`stateRegistration.abort()` is called and `drainException` is thrown.
Consider guarding the completion/checkpoint/finalization callbacks at lines
561–567 with `if (drainException == null)` so that a bundle whose output drain
failed does not report completion or register finalization/residuals.
--
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]