Flaugh24 commented on code in PR #2390:
URL: https://github.com/apache/ignite-3/pull/2390#discussion_r1296075408


##########
modules/file-transfer/src/main/java/org/apache/ignite/internal/network/file/FileSender.java:
##########
@@ -197,9 +209,16 @@ private CompletableFuture<Void> sendMessagesFromStream(
     ) {
         try {
             if (stream.hasNextMessage() && !shouldBeCancelled.get()) {
-                return messagingService.send(receiverConsistentId, 
FILE_TRANSFER_CHANNEL, stream.nextMessage())
+                return messagingService.invoke(receiverConsistentId, 
FILE_TRANSFER_CHANNEL, stream.nextMessage(), responseTimeout)
+                        .thenApply(FileChunkResponse.class::cast)
                         .thenComposeAsync(
-                                ignored -> 
sendMessagesFromStream(receiverConsistentId, stream, shouldBeCancelled),
+                                ack -> {
+                                    if (ack.error() != null) {
+                                        return 
failedFuture(toException(ack.error()));

Review Comment:
   If org.apache.ignite.internal.network.file.FileSender#send returns a failed 
CompletableFuture, a FileTransferErrorMessage will be sent to the receiver. See 
org.apache.ignite.internal.network.file.FileTransferServiceImpl#sendFiles. 
Additionally, a test exists for this scenario:  
org.apache.ignite.internal.network.file.FileTransferServiceImplTest#uploadFailsWhenSenderReturnsException



-- 
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]

Reply via email to