From dev-return-60453-archive-asf-public=cust-asf.ponee.io@storm.apache.org Tue Aug 13 06:03:40 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 B7A9D1804BB for ; Tue, 13 Aug 2019 08:03:39 +0200 (CEST) Received: (qmail 41753 invoked by uid 500); 13 Aug 2019 06:03:39 -0000 Mailing-List: contact dev-help@storm.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@storm.apache.org Delivered-To: mailing list dev@storm.apache.org Received: (qmail 41740 invoked by uid 99); 13 Aug 2019 06:03:38 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Aug 2019 06:03:38 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 282DEC0801 for ; Tue, 13 Aug 2019 06:03:38 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.9 X-Spam-Level: * X-Spam-Status: No, score=1.9 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=2, KAM_UNSUB1=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-he-de.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Q1syYApETCCu for ; Tue, 13 Aug 2019 06:03:34 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::331; helo=mail-ot1-x331.google.com; envelope-from=aniket.alhat@gmail.com; receiver= Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by mx1-he-de.apache.org (ASF Mail Server at mx1-he-de.apache.org) with ESMTPS id DB1317D3FB for ; Tue, 13 Aug 2019 06:03:33 +0000 (UTC) Received: by mail-ot1-x331.google.com with SMTP id z17so49789634otk.13 for ; Mon, 12 Aug 2019 23:03:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=ZiU34MMWqFCiHU+aKI0064qMxTw6TAQ0t4nOq5c8maw=; b=Fn/GCUIH8SSc+nbBQeZJhKKVrfHpc8Cu8Usv50VnIGuectIzkWD4PLD7cMxtmky7DY nBi9ueHbIQWK55VcVk/jv3IxY4Wirx3Hgp9YIKFfTP3irolTAX5SRXJkPGA76LIyPo0X k+gsFLDEiEBICHXlDwjCBZXCkfd8edcOblufNdTWalcqtxesRQrGf3CKPX1x5xp+KNGl ZUMrYKb/QtPQPsjX03CXwlj7GUkjXx7ruX13rccqfcztCCKYeiCExhugycBCCVyf/pNC ZO2ev5Jm+CYmf/T2AZvowkQUD0OAz+nQtON3q/wix4b+RAOVsjLq2B4wjJFTqvD8LM7Q d9TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=ZiU34MMWqFCiHU+aKI0064qMxTw6TAQ0t4nOq5c8maw=; b=TLWl5hshG+clC6NGkIxXR3gLHLWEGJ9plrTnVtuXuzzZFT6JXvJeBAqCLVhQahVzdr zMU3hm3iIF9Z7DUJ9HUyBSHymkXl6uDMecCQm40Rj/E85TUiRqc6YegjTeE3/v5WbJ9Z xmkwc6+GnWZ/q3d+GVPD7bI4MR+EbEc0s24HRvIcNm4C+7hX5RIyPswvoHcVeIcpS678 SgDu6zkKdjZT2zkqrLDwocQ9BHxpEAgvET9Rj0rlMde5uHfT2DwG+Yk4NP9YnsylyuME q/HaiWYLp4wqaxHWOIncJ3n878pfMyheKekOvS3agLzL8Ln/AS1Yqvrw8WFwNMIX90Zf 0vdA== X-Gm-Message-State: APjAAAUSVS64gXwxm+cFBEkqgUPee71aiwbmrXy7zjAH13BslRJD7aMr CMghRLzX1cxErgLljhm+adgLco/SGVQwi8erbjPh8QHX X-Google-Smtp-Source: APXvYqxKK0Efc5YRFXV0bwPi8kzGaTLyy42PFuq5uz8EgNk+jhimi+HwVtEJQ0Uf6y8GCXkwSGmiCeXc6/GplNZP7rk= X-Received: by 2002:a6b:c581:: with SMTP id v123mr17694407iof.158.1565676212250; Mon, 12 Aug 2019 23:03:32 -0700 (PDT) MIME-Version: 1.0 References: <156567614918.19920.1442963960486295723.gitbox@gitbox.apache.org> In-Reply-To: <156567614918.19920.1442963960486295723.gitbox@gitbox.apache.org> From: Aniket Alhat Date: Tue, 13 Aug 2019 15:03:28 +0900 Message-ID: Subject: Re: [GitHub] [storm] jacobtolar commented on a change in pull request #2878: [STORM-3257] 'storm kill' command line should be able to continue on error To: dev@storm.apache.org Content-Type: multipart/alternative; boundary="00000000000076efad058ff96614" --00000000000076efad058ff96614 Content-Type: text/plain; charset="UTF-8" UNSUBSCRIBE On Tue, Aug 13, 2019 at 3:02 PM GitBox wrote: > jacobtolar commented on a change in pull request #2878: [STORM-3257] > 'storm kill' command line should be able to continue on error > URL: https://github.com/apache/storm/pull/2878#discussion_r313230484 > > > > ########## > File path: storm-core/src/jvm/org/apache/storm/command/KillTopology.java > ########## > @@ -25,21 +25,49 @@ > > public static void main(String[] args) throws Exception { > Map cl = CLI.opt("w", "wait", null, CLI.AS_INT) > + .boolOpt("i", "ignore-errors") > .arg("TOPO", CLI.INTO_LIST) > .parse(args); > + > + @SuppressWarnings("unchecked") > final List names = (List) cl.get("TOPO"); > + > + // wait seconds for topology to shut down > Integer wait = (Integer) cl.get("w"); > > + // if '-i' set, we'll try to kill every topology listed, even if > an error occurs > + Boolean continueOnError = (Boolean) cl.get("i"); > + > final KillOptions opts = new KillOptions(); > if (wait != null) { > opts.set_wait_secs(wait); > } > + > NimbusClient.withConfiguredClient(new NimbusClient.WithNimbus() { > @Override > public void run(Nimbus.Iface nimbus) throws Exception { > + int errorCount = 0; > for (String name : names) { > - nimbus.killTopologyWithOpts(name, opts); > - LOG.info("Killed topology: {}", name); > + try { > + nimbus.killTopologyWithOpts(name, opts); > + LOG.info("Killed topology: {}", name); > + } catch (Exception e) { > + errorCount += 1; > + if (!continueOnError) { > + throw e; > + } else { > + LOG.info( > + "Caught error killing topology '{}'; > continuing as -i was passed. Exception: {}", > + name, > + e.getClass().getName() > + ); > + } > + } > + } > + > + // If we failed to kill any topology, still exit with > failure status > + if (errorCount > 0) { > + throw new RuntimeException("Failed to successfully > kill " + errorCount + " topologies."); > > Review comment: > They'll already be logged above; is the suggestion to log the names > again here? > > ---------------------------------------------------------------- > This is an automated message from the Apache Git Service. > To respond to the message, please log on to 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 > --00000000000076efad058ff96614--