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:23:38 UTC
[GitHub] sijie commented on a change in pull request #2748: Fix getstatus
logic in kubernetes runtime
sijie commented on a change in pull request #2748: Fix getstatus logic in kubernetes runtime
URL: https://github.com/apache/pulsar/pull/2748#discussion_r223531507
##########
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:
shouldn't we just fail the request with 500? and we don't need to add error field in FunctionStatus struct
----------------------------------------------------------------
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