You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/10/09 00:25:17 UTC

[GitHub] jerrypeng commented on a change in pull request #2748: Fix getstatus logic in kubernetes runtime

jerrypeng commented on a change in pull request #2748: Fix getstatus logic in kubernetes runtime
URL: https://github.com/apache/pulsar/pull/2748#discussion_r223531707
 
 

 ##########
 File path: pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/FunctionRuntimeManager.java
 ##########
 @@ -491,7 +491,24 @@ private void stopFunction(String fullyQualifiedInstanceId, boolean restart) thro
                     functionStatusListBuilder.addFunctionStatusList(functionStatus);
                 }
             } else {
-                return this.functionAdmin.functions().getFunctionStatus(tenant, namespace, functionName);
+                // find the hostname/port of the worker who is the owner
+
+                List<WorkerInfo> workerInfoList = this.membershipManager.getCurrentMembership();
+                WorkerInfo workerInfo = null;
+                for (WorkerInfo entry: workerInfoList) {
+                    if (assignment.getWorkerId().equals(entry.getWorkerId())) {
+                        workerInfo = entry;
+                    }
+                }
+                if (workerInfo == null) {
+                    InstanceCommunication.FunctionStatusList.Builder functionStatusBuilder
+                            = InstanceCommunication.FunctionStatusList.newBuilder();
+                    functionStatusBuilder.setError("Function not yet scheduled");
 
 Review comment:
   it should't be an internal server error.  I think it should be a 503 "service not available"

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services