Tiscs commented on a change in pull request #7710: URL: https://github.com/apache/pulsar/pull/7710#discussion_r483355016
########## File path: pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java ########## @@ -415,28 +415,45 @@ private void setupStateTable() 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(); + private void processResult(Record srcRecord, JavaExecutionResult result, Throwable throwable) throws Exception { + throwable = throwable == null ? result.getUserException() : throwable; + if (result.getUserException() != null) { Review comment: Should replace `result.getUserException()` to local variable `throwable` here? ---------------------------------------------------------------- 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