Victsm commented on a change in pull request #33613:
URL: https://github.com/apache/spark/pull/33613#discussion_r683650921
##########
File path:
common/network-common/src/main/java/org/apache/spark/network/server/TransportRequestHandler.java
##########
@@ -213,7 +213,15 @@ public void onData(String streamId, ByteBuffer buf) throws
IOException {
public void onComplete(String streamId) throws IOException {
try {
streamHandler.onComplete(streamId);
- callback.onSuccess(ByteBuffer.allocate(0));
+ callback.onSuccess(streamHandler.getCompletionResponse());
+ } catch (BlockPushNonFatalFailure ex) {
Review comment:
We still need to invoke `streamHandler#onFailure` in case we get a
non-success return code, which handles logging and other things.
Catching the `BlockPushNonFatalFailure` inside `onComplete` makes it hard to
tell apart a success and an error case.
I feel that returning a `ByteBuffer` in
`StreamCallback#getCompletionResponse` is generic enough since `StreamCallback`
is used for multiple purposes.
Returning a `BlockPushNonFatalFailure` in `StreamCallback` feels too
specific for only 1 use case of this interface.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]