From commits-return-15793-archive-asf-public=cust-asf.ponee.io@pulsar.apache.org Tue Oct 9 02:28:30 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 953B818067A for ; Tue, 9 Oct 2018 02:28:30 +0200 (CEST) Received: (qmail 11928 invoked by uid 500); 9 Oct 2018 00:28:29 -0000 Mailing-List: contact commits-help@pulsar.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pulsar.apache.org Delivered-To: mailing list commits@pulsar.apache.org Received: (qmail 11919 invoked by uid 99); 9 Oct 2018 00:28:29 -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; Tue, 09 Oct 2018 00:28:29 +0000 From: GitBox To: commits@pulsar.apache.org Subject: [GitHub] jerrypeng commented on a change in pull request #2748: Fix getstatus logic in kubernetes runtime Message-ID: <153904490915.26654.8964798343953146518.gitbox@gitbox.apache.org> Date: Tue, 09 Oct 2018 00:28:29 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit jerrypeng commented on a change in pull request #2748: Fix getstatus logic in kubernetes runtime URL: https://github.com/apache/pulsar/pull/2748#discussion_r223532126 ########## 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 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: but we should return the message message because it is useful for the user ---------------------------------------------------------------- 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