This is an automated email from the ASF dual-hosted git repository.

rdhabalia pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 2ae20e2  Log and Return error-message on function-stats failure (#2517)
2ae20e2 is described below

commit 2ae20e2f55ccacff1a6201986a5c3f2e7a0ca6bc
Author: Rajan Dhabalia <rdhaba...@apache.org>
AuthorDate: Wed Sep 5 10:37:30 2018 -0700

    Log and Return error-message on function-stats failure (#2517)
---
 .../apache/pulsar/functions/worker/rest/api/FunctionsImpl.java    | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git 
a/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/FunctionsImpl.java
 
b/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/FunctionsImpl.java
index e9c1276..136bab0 100644
--- 
a/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/FunctionsImpl.java
+++ 
b/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/FunctionsImpl.java
@@ -360,12 +360,8 @@ public class FunctionsImpl {
             functionStatus = 
functionRuntimeManager.getFunctionInstanceStatus(tenant, namespace, 
functionName,
                     Integer.parseInt(instanceId));
         } catch (Exception e) {
-            log.error("Got Exception Getting Status", e);
-            FunctionStatus.Builder functionStatusBuilder = 
FunctionStatus.newBuilder();
-            functionStatusBuilder.setRunning(false);
-            String functionDetailsJson = 
org.apache.pulsar.functions.utils.Utils
-                    .printJson(functionStatusBuilder.build());
-            return 
Response.status(Status.OK).entity(functionDetailsJson).build();
+            log.error("{}/{}/{} Got Exception Getting Status", tenant, 
namespace, functionName, e);
+            return 
Response.status(Status.INTERNAL_SERVER_ERROR.getStatusCode(), 
e.getMessage()).build();
         }
 
         String jsonResponse = 
org.apache.pulsar.functions.utils.Utils.printJson(functionStatus);

Reply via email to