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



##########
File path: 
pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java
##########
@@ -317,46 +322,77 @@ private void setupStateStore() throws Exception {
         }
     }
 
-    private void processResult(Record srcRecord,
-                               CompletableFuture<JavaExecutionResult> result) 
throws Exception {
-        result.whenComplete((result1, throwable) -> {
-            if (throwable != null || result1.getUserException() != null) {
-                Throwable t = throwable != null ? throwable : 
result1.getUserException();
-                log.warn("Encountered exception when processing message {}",
-                        srcRecord, t);
-                stats.incrUserExceptions(t);
-                srcRecord.fail();
-            } else {
-                if (result1.getResult() != null) {
-                    sendOutputMessage(srcRecord, result1.getResult());
+    private void processResult(@SuppressWarnings("rawtypes") Record srcRecord,
+                               JavaExecutionResult result) throws 
SinkException {
+       
+       if (result.getUserException() != null) {

Review comment:
       This is where we do the error handling for the synchronous function 
calls. The logic inside this block is identical to error handling logic for 
asynchronous function calls.




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