Return-Path: X-Original-To: apmail-streams-dev-archive@minotaur.apache.org Delivered-To: apmail-streams-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A985E17FF8 for ; Wed, 8 Oct 2014 17:30:26 +0000 (UTC) Received: (qmail 24004 invoked by uid 500); 8 Oct 2014 17:30:26 -0000 Delivered-To: apmail-streams-dev-archive@streams.apache.org Received: (qmail 23957 invoked by uid 500); 8 Oct 2014 17:30:26 -0000 Mailing-List: contact dev-help@streams.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@streams.incubator.apache.org Delivered-To: mailing list dev@streams.incubator.apache.org Received: (qmail 23945 invoked by uid 99); 8 Oct 2014 17:30:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Oct 2014 17:30:26 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ryanebanks@gmail.com designates 209.85.218.43 as permitted sender) Received: from [209.85.218.43] (HELO mail-oi0-f43.google.com) (209.85.218.43) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Oct 2014 17:29:59 +0000 Received: by mail-oi0-f43.google.com with SMTP id u20so8357795oif.16 for ; Wed, 08 Oct 2014 10:29:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=7/uGQGpgYDBLL9FchFWXoyirvNR8lTjibtKHBLI1j3o=; b=CAgxeunGLmBHQ/mx+PevGsvXSj2i/8wJh/oqZfnfaMGQ6UtokugvwyDwAsQlYnSHpC EkqViG+D+EnZAYSBwJI5nNqKk+t2tqgpvUCh9jcW00m1/oPrKBaH5a964INQeLAt9IHV e7Y5qkke+fSKIXqgXCsarcfUh+yeMflbMXcUpUR3qONd6Kb0Vp/0EoQfwnZEuOD56w9O iy55Xg/tYN7yS8erM6MOhTgRHWt/OAe1ZuycnGAvG0jA62qnzAOswvnoaOmL4i8P6BYm YId721xRbQhUeoC78DQ5EOX6TPl0qObhj7ld89xcMANN2TcDf4JfDy/8HqeibIbMOL6K r7bQ== MIME-Version: 1.0 X-Received: by 10.60.124.115 with SMTP id mh19mr14210432oeb.40.1412789397433; Wed, 08 Oct 2014 10:29:57 -0700 (PDT) Received: by 10.76.69.74 with HTTP; Wed, 8 Oct 2014 10:29:57 -0700 (PDT) In-Reply-To: References: Date: Wed, 8 Oct 2014 12:29:57 -0500 Message-ID: Subject: Re: LocalStreamBuilder#stop() From: Ryan Ebanks To: dev@streams.incubator.apache.org Content-Type: multipart/alternative; boundary=047d7b5d375a2d38ee0504ecaa58 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b5d375a2d38ee0504ecaa58 Content-Type: text/plain; charset=UTF-8 Ok. I agree that 2b is the most appropriate. It will require the most code change though. Right now the code does option 1 and test assumes option 2. I'll @Ignore the test for now, and we can make this change in another pull request as I don't want this one to get too big. That means the code will continue with option 1 for now. -Ryan On Wed, Oct 8, 2014 at 11:49 AM, Steve Blackmon wrote: > I also prefer 2b. > > The grace period before forceful termination should be configurable > either at compile-time by the pipeline or preferably at run-time via > the type safe config. > > A config fragment like this detected by the runtime and enforced > absolutely would be a good start. The implementation shouldn't be > responsible for parsing args and creating a Map. > > runtime { > shutdown { > stopProviders { > timeAfterStart: "30m" > } > forceful { > timeAfterStopProviders: "5m" > } > } > } > > Steve > Steve Blackmon > sblackmon@apache.org > > > On Wed, Oct 8, 2014 at 10:55 AM, Robert Douglas > wrote: > > Hi Ryan, > > > > I think the most important thing is to ensure that anytime "stop()" is > > called, the behavior is deterministic. When that method is called, we > need > > a guarantee that things will completely shut down in a reasonable amount > of > > time. However, I don't like the idea of just abandoning datums that are > > already in the pipeline. If it's possible, I'd prefer to go with an > > approach similar to option 2b. Completely shutdown the providers, and > give > > the Stream some time to attempt to process all currently queued datums. > > However, after a certain period of time, I think that a forceful shutdown > > needs to be executed regardless of the state of the pipeline. > > > > -- Robert Douglas > > > > On Wed, Oct 8, 2014 at 10:31 AM, Ryan Ebanks > wrote: > > > >> I've been added tests and fixing some issues in the local stream builder > >> class. I need some input on how the stop() method should work so I can > >> write the appropriate tests. > >> > >> Option 1.) Gentle Shutdown > >> Immediately stop the providers from producing more data, but allow for > all > >> data currently in the stream to finish processing. Shutdown time would > be > >> unknown as a result. > >> > >> Option 2.) Forceful Shutdown > >> Immediately stop the providers from producing more data, and stop all > >> processors/writers. Data will be left in the pipeline will be > discarded. > >> shutdown will be immediate > >> > >> Option 2b) Forceful Shutdown after small wait > >> Immediately stop providers from producing more data. Give the > >> processors/writers a small window to try to finish processing (< > 10secs), > >> and if not finished, forcefully shutdown all processors/writers. > >> > >> > >> These options can be changed in the future as more features are added. > For > >> example once datum tracking is implemented, we will probably want a > >> combination of option 1 and 2b. But we need a defined way for it work > now, > >> so tests are testing the correct functionality. > >> > >> -Ryan Ebanks > >> > --047d7b5d375a2d38ee0504ecaa58--