david-streamlio commented on a change in pull request #10370:
URL: https://github.com/apache/pulsar/pull/10370#discussion_r620550371



##########
File path: 
pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java
##########
@@ -328,7 +342,8 @@ private void processResult(Record srcRecord,
                 srcRecord.fail();
             } else {
                 if (result1.getResult() != null) {
-                    sendOutputMessage(srcRecord, result1.getResult());
+                       // Grab the actual result
+                       actualResult.set(result1.getResult());

Review comment:
       Can you elaborate a bit? FWIW, I have tried various scenarios to keep 
the call to `sendOutputMessage(srcRecord, result1.getResult());` insdie the 
`whenComplete` completion stage, but in all scenarios, the exception thrown is 
lost. I tried catching the exception and re-throwing a `CompletionException` 
and also tried calling `result.completeExceptionally()` on the sink error as 
well. In both cases the exception thrown by the Sink is lost. This was the only 
way to have the exception thrown by the Sink actually caught and handled.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to