From commits-return-7332-archive-asf-public=cust-asf.ponee.io@openwhisk.apache.org Mon May 13 20:58:34 2019 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 [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 09976180671 for ; Mon, 13 May 2019 22:58:33 +0200 (CEST) Received: (qmail 648 invoked by uid 500); 13 May 2019 20:58:33 -0000 Mailing-List: contact commits-help@openwhisk.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openwhisk.apache.org Delivered-To: mailing list commits@openwhisk.apache.org Received: (qmail 639 invoked by uid 99); 13 May 2019 20:58:33 -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; Mon, 13 May 2019 20:58:33 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 4B20287339; Mon, 13 May 2019 20:58:33 +0000 (UTC) Date: Mon, 13 May 2019 20:58:33 +0000 To: "commits@openwhisk.apache.org" Subject: [incubator-openwhisk-package-kafka] branch master updated: Set running state after brokers are connected (#340) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <155778111323.7571.7732080911678046653@gitbox.apache.org> From: japetrsn@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-openwhisk-package-kafka X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: cdb1de87c9042b4e6d425d80302d437b20e672ec X-Git-Newrev: 30f549db6014bcc3e8e1e340e39a2f5cdc58a784 X-Git-Rev: 30f549db6014bcc3e8e1e340e39a2f5cdc58a784 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. japetrsn pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-package-kafka.git The following commit(s) were added to refs/heads/master by this push: new 30f549d Set running state after brokers are connected (#340) 30f549d is described below commit 30f549db6014bcc3e8e1e340e39a2f5cdc58a784 Author: James Dubee AuthorDate: Mon May 13 16:58:28 2019 -0400 Set running state after brokers are connected (#340) --- provider/consumer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/provider/consumer.py b/provider/consumer.py index 2ced050..91d4094 100644 --- a/provider/consumer.py +++ b/provider/consumer.py @@ -329,7 +329,6 @@ class ConsumerProcess (Process): if self.secondsSinceLastPoll() < 0: logging.info('[{}] Completed first poll'.format(self.trigger)) - self.__recordState(Consumer.State.Running) if (message is not None): if not message.error(): @@ -530,6 +529,10 @@ class ConsumerProcess (Process): def __on_assign(self, consumer, partitions): logging.info('[{}] Completed partition assignment. Connected to broker(s)'.format(self.trigger)) + if self.currentState() == Consumer.State.Initializing and self.__shouldRun(): + logging.info('[{}] Setting consumer state to runnning.'.format(self.trigger)) + self.__recordState(Consumer.State.Running) + def __on_revoke(self, consumer, partitions): logging.info('[{}] Partition assignment has been revoked. Disconnected from broker(s)'.format(self.trigger))