rdhabalia closed pull request #2517: Log and Return error-message on 
function-stats failure
URL: https://github.com/apache/incubator-pulsar/pull/2517
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 e9c127667d..136bab0af7 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 Response getFunctionInstanceStatus(final String 
tenant, final String name
             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);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to