From commits-return-13361-archive-asf-public=cust-asf.ponee.io@pulsar.incubator.apache.org Mon Aug 27 11:19:19 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 25EC4180674 for ; Mon, 27 Aug 2018 11:19:18 +0200 (CEST) Received: (qmail 52360 invoked by uid 500); 27 Aug 2018 09:19:18 -0000 Mailing-List: contact commits-help@pulsar.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pulsar.incubator.apache.org Delivered-To: mailing list commits@pulsar.incubator.apache.org Received: (qmail 52351 invoked by uid 99); 27 Aug 2018 09:19:18 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Aug 2018 09:19:18 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id B6AF1807E9; Mon, 27 Aug 2018 09:19:17 +0000 (UTC) Date: Mon, 27 Aug 2018 09:19:17 +0000 To: "commits@pulsar.apache.org" Subject: [incubator-pulsar] branch branch-2.1 updated: Set correct exception if function runnable fails with Error (#2353) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <153536155760.31381.14986642361884033556@gitbox.apache.org> From: sijie@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-pulsar X-Git-Refname: refs/heads/branch-2.1 X-Git-Reftype: branch X-Git-Oldrev: 4db7f38cfaf96c5a2f524a780b854b8df1878b57 X-Git-Newrev: 7a0ca5ae1be8d03828ef224350576755fa5f8af9 X-Git-Rev: 7a0ca5ae1be8d03828ef224350576755fa5f8af9 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. sijie pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git The following commit(s) were added to refs/heads/branch-2.1 by this push: new 7a0ca5a Set correct exception if function runnable fails with Error (#2353) 7a0ca5a is described below commit 7a0ca5ae1be8d03828ef224350576755fa5f8af9 Author: Rajan Dhabalia AuthorDate: Mon Aug 13 21:20:02 2018 -0700 Set correct exception if function runnable fails with Error (#2353) * Set correct exception if function runnable fails with Error * fix throwable set --- .../org/apache/pulsar/functions/instance/JavaInstanceRunnable.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java index b64224f..68df84a 100644 --- a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java +++ b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/JavaInstanceRunnable.java @@ -181,8 +181,10 @@ public class JavaInstanceRunnable implements AutoCloseable, Runnable { */ @Override public void run() { + String functionName = null; try { ContextImpl contextImpl = setupContext(); + functionName = String.format("%s-%s", contextImpl.getTenant(), contextImpl.getFunctionName()); javaInstance = setupJavaInstance(contextImpl); if (null != stateTable) { StateContextImpl stateContext = new StateContextImpl(stateTable); @@ -229,8 +231,8 @@ public class JavaInstanceRunnable implements AutoCloseable, Runnable { } } } catch (Throwable t) { - log.error("Uncaught exception in Java Instance", t); - deathException = (Exception) t; + log.error("[{}] Uncaught exception in Java Instance", functionName, t); + deathException = t; return; } finally { log.info("Closing instance");