Return-Path: X-Original-To: apmail-asterixdb-dev-archive@minotaur.apache.org Delivered-To: apmail-asterixdb-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 DFFE21835C for ; Tue, 25 Aug 2015 06:18:32 +0000 (UTC) Received: (qmail 23442 invoked by uid 500); 25 Aug 2015 06:18:32 -0000 Delivered-To: apmail-asterixdb-dev-archive@asterixdb.apache.org Received: (qmail 23388 invoked by uid 500); 25 Aug 2015 06:18:32 -0000 Mailing-List: contact dev-help@asterixdb.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@asterixdb.incubator.apache.org Delivered-To: mailing list dev@asterixdb.incubator.apache.org Received: (qmail 23376 invoked by uid 99); 25 Aug 2015 06:18:32 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Aug 2015 06:18:32 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 045251AACC1 for ; Tue, 25 Aug 2015 06:18:32 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.901 X-Spam-Level: *** X-Spam-Status: No, score=3.901 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_REPLY=1, HTML_MESSAGE=3, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id UEJyzEAjHFkd for ; Tue, 25 Aug 2015 06:18:17 +0000 (UTC) Received: from mail-ob0-f181.google.com (mail-ob0-f181.google.com [209.85.214.181]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 9071D42B9B for ; Tue, 25 Aug 2015 06:18:17 +0000 (UTC) Received: by obbfr1 with SMTP id fr1so133579262obb.1 for ; Mon, 24 Aug 2015 23:18:17 -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=LmUCt27dGFQz1q96djmevMPKqTQdSCfwrwcs48LWyzg=; b=rXyhuANGNhU06DwTPysSlxuHkEDwAomiAfocyXJ52+zVGMUmUm3CyvriUM/ePv8Y4K 3JGPMdWaj1DqH1nZBzqUHtp6FgaHf6lQEV1qykKNBur/62aUoQt5jwMfz8nDpJhzp6PS Y93ewmyog6VWD+LnBp7qjU4d333ez7Mo2AXMRT/NWeE1qdr/GePG0nOW3AfgCTb+K84c rjSQZzNrI3E6T9jAMYVfpgE0VhG+Ko4kjzVDBQUwUjCHDPBxUAJQlbExMN264Zn7H1DK DOM/d6HtW7T1j/DUNm3/HPAJ1PViTkTekrtqrPaY8UiHCA4uB2JbROJrwKR6PSJsfE3T IZXQ== MIME-Version: 1.0 X-Received: by 10.60.134.132 with SMTP id pk4mr26060669oeb.44.1440483497117; Mon, 24 Aug 2015 23:18:17 -0700 (PDT) Received: by 10.76.21.230 with HTTP; Mon, 24 Aug 2015 23:18:17 -0700 (PDT) In-Reply-To: References: Date: Tue, 25 Aug 2015 09:18:17 +0300 Message-ID: Subject: Re: The solution to the sporadic connection refused exceptions From: abdullah alamoudi To: dev@asterixdb.incubator.apache.org Content-Type: multipart/alternative; boundary=047d7b47252c268e1f051e1cb3f3 --047d7b47252c268e1f051e1cb3f3 Content-Type: text/plain; charset=UTF-8 Thanks Raman, I already figured that out. I am currently looking into synchronization (Even though I don't need it right now) but it can definitely become handy in future tasks. Cheers, Abdullah. P.S Using ZooKeeper seems the cleaner/easier approach. Thanks for bringing this up :-) On Tue, Aug 25, 2015 at 9:06 AM, Raman Grover wrote: > Abdullah, Zookeeper allows setting up a "watch" on any node (recall that > internally zookeeper maintains info as a tree of nodes, called znodes). > Check out the zookeeper API here > < > http://zookeeper.apache.org/doc/trunk/zookeeperProgrammers.html#ch_zkWatches > >. > Watch nodes are a common mechanism for notifying changes to information > stored within a node, creation/deletion of a child under the node or > deletion of node. > One can attach listeners and be notified. > > > Regards, > Raman > > On Mon, Aug 24, 2015 at 9:47 PM, abdullah alamoudi > wrote: > > > @Raman, > > I will look into doing it with Zookeeper. > > > > Is there a way to notify Managix once the cluster state has been updated > in > > Zookeeper? or would Managix have to poll and check the state? > > > > Cheers, > > Abdullah. > > > > On Tue, Aug 25, 2015 at 3:28 AM, Raman Grover > > wrote: > > > > > Well, the state of an instance (and metadata including configuration) > is > > > kept in Zookeeper instance that is accessible to Managix and CC. CC > > should > > > be able to set the state of the cluster in Zookeeper under the right > > znode > > > which can viewed by Managix. > > > > > > There exists a communication channel for CC and Managix to share > > > information on state etc. I am not sure if we need another channel such > > as > > > RMI between Managix and CC. > > > > > > Regards, > > > Raman > > > > > > > > > > > > On Mon, Aug 24, 2015 at 12:58 PM, abdullah alamoudi < > bamousaa@gmail.com> > > > wrote: > > > > > > > Well, it depends on your definition of the boundaries of managix. > What > > I > > > > did is that I added an RMI object in the InstallerDriver which > > basically > > > > listen for state changes from the cluster controller. This means some > > > > additional logic in the CCApplicationEntryPoint where after the CC is > > > > ready, it contacts the InstallerDriver using RMI and at that point > > only, > > > > the InstallerDriver can return to managix and tells it that the > startup > > > is > > > > complete. > > > > > > > > Not sure if this is the right way to do it but it definitely is > better > > > than > > > > what we currently have. > > > > Abdullah. > > > > > > > > On Mon, Aug 24, 2015 at 10:00 PM, Chris Hillery > > > > > > > wrote: > > > > > > > > > Hopefully the solution won't involve additional important logic > > inside > > > > > Managix itself? > > > > > > > > > > Ceej > > > > > aka Chris Hillery > > > > > > > > > > On Mon, Aug 24, 2015 at 7:26 AM, abdullah alamoudi < > > bamousaa@gmail.com > > > > > > > > > wrote: > > > > > > > > > > > That works but it doesn't feel right doing it this way. I am > going > > to > > > > fix > > > > > > this one for good. > > > > > > > > > > > > Cheers, > > > > > > Abdullah. > > > > > > > > > > > > On Mon, Aug 24, 2015 at 5:11 PM, Ian Maxon > wrote: > > > > > > > > > > > > > The way I assured liveness for the YARN installer was to try > > > running > > > > > "for > > > > > > > $x in dataset Metadata.Dataset return $x" via the API. I just > > > polled > > > > > for > > > > > > a > > > > > > > reasonable amount of time (though honestly, thinking about it > > now, > > > > the > > > > > > > correct parameter to use for the polling interval is the > startup > > > wait > > > > > > time > > > > > > > in the parameters file :) ). It's not perfect, but it gives > less > > > > false > > > > > > > positives than just checking ps for processes that look like > > > CCs/NCs. > > > > > > > > > > > > > > - Ian. > > > > > > > > > > > > > > On Mon, Aug 24, 2015 at 5:03 AM, abdullah alamoudi < > > > > bamousaa@gmail.com > > > > > > > > > > > > > wrote: > > > > > > > > > > > > > > > Now that I think about it. Maybe we should provide multiple > > ways > > > to > > > > > do > > > > > > > > this. A polling mechanism to be used for arbitrary time and a > > > > pushing > > > > > > > > mechanism on startup. > > > > > > > > I am going to start implementation of this and will probably > > use > > > > RMI > > > > > > for > > > > > > > > this task both ways (CC to InstallerDriver and > InstallerDriver > > to > > > > > CC). > > > > > > > > > > > > > > > > Cheers, > > > > > > > > Abdullah. > > > > > > > > > > > > > > > > On Mon, Aug 24, 2015 at 2:19 PM, abdullah alamoudi < > > > > > bamousaa@gmail.com > > > > > > > > > > > > > > > wrote: > > > > > > > > > > > > > > > > > So after further investigation, turned out our startup > > process > > > > just > > > > > > > > starts > > > > > > > > > the CC and NC processes and then make sure the processes > are > > > > > running > > > > > > > and > > > > > > > > if > > > > > > > > > the processes were found to be running, it returns the > state > > of > > > > the > > > > > > > > cluster > > > > > > > > > to be active and the subsequent test commands can start > > > > > immediately. > > > > > > > > > > > > > > > > > > This means that the CC could've started but is not yet > ready > > > when > > > > > we > > > > > > > try > > > > > > > > > to process the next command. To address this, we need a > > better > > > > way > > > > > to > > > > > > > > tell > > > > > > > > > when the startup procedure has completed. we can do this by > > > > pushing > > > > > > (CC > > > > > > > > > informs installer driver when the startup is complete) or > > > polling > > > > > > (The > > > > > > > > > installer driver needs to actually query the CC for the > state > > > of > > > > > the > > > > > > > > > cluster). > > > > > > > > > > > > > > > > > > I can do either way so let's vote. My vote goes to the > > pushing > > > > > > > mechanism. > > > > > > > > > Thoughts? > > > > > > > > > > > > > > > > > > On Mon, Aug 24, 2015 at 10:15 AM, abdullah alamoudi < > > > > > > > bamousaa@gmail.com> > > > > > > > > > wrote: > > > > > > > > > > > > > > > > > >> This solution turned out to be incorrect. Actually, the > test > > > > cases > > > > > > > when > > > > > > > > I > > > > > > > > >> build after using the join method never fails but running > an > > > > > actual > > > > > > > > asterix > > > > > > > > >> instance never succeeds which is quite confusing. > > > > > > > > >> > > > > > > > > >> I also think that the startup script has a major bug where > > it > > > > > might > > > > > > > > >> returns before the startup is complete. More on this > > > later...... > > > > > > > > >> > > > > > > > > >> On Mon, Aug 24, 2015 at 7:48 AM, abdullah alamoudi < > > > > > > > bamousaa@gmail.com> > > > > > > > > >> wrote: > > > > > > > > >> > > > > > > > > >>> It is highly unlikely that it is related. > > > > > > > > >>> > > > > > > > > >>> Cheers, > > > > > > > > >>> Abdullah. > > > > > > > > >>> > > > > > > > > >>> On Mon, Aug 24, 2015 at 5:45 AM, Chen Li < > chenli@gmail.com > > > > > > > > wrote: > > > > > > > > >>> > > > > > > > > >>>> @Abdullah: Is this issue related to > > > > > > > > >>>> https://issues.apache.org/jira/browse/ASTERIXDB-1074? > Ian > > > > and I > > > > > > > plan > > > > > > > > to > > > > > > > > >>>> look into the details on Monday. > > > > > > > > >>>> > > > > > > > > >>>> On Sun, Aug 23, 2015 at 10:08 AM, abdullah alamoudi < > > > > > > > > bamousaa@gmail.com > > > > > > > > >>>> > > > > > > > > > >>>> wrote: > > > > > > > > >>>> > > > > > > > > >>>> > About 3-4 days ago, I was working on the addition of > the > > > > > > > filesystem > > > > > > > > >>>> based > > > > > > > > >>>> > feed adapter and it didn't take anytime to complete. > > > > However, > > > > > > > when I > > > > > > > > >>>> wanted > > > > > > > > >>>> > to build and make sure all tests pass, I kept getting > > > > > > > > >>>> ConnectionRefused > > > > > > > > >>>> > errors which caused the installer tests to fail every > > now > > > > and > > > > > > > then. > > > > > > > > >>>> > > > > > > > > > >>>> > I knew the new change had nothing to do with this > > failure, > > > > > yet, > > > > > > I > > > > > > > > >>>> couldn't > > > > > > > > >>>> > direct my attention away from this bug (It just > bothered > > > me > > > > so > > > > > > > much > > > > > > > > >>>> and I > > > > > > > > >>>> > knew it needs to be resolved ASAP). After wasting > > > countless > > > > > > > hours, I > > > > > > > > >>>> was > > > > > > > > >>>> > finally able to figure out what was happening :-) > > > > > > > > >>>> > > > > > > > > > >>>> > In the startup routine, we start three Jetty web > servers > > > > (Web > > > > > > > > >>>> interface > > > > > > > > >>>> > server, JSON API server, and Feed server). Sometime > ago, > > > we > > > > > used > > > > > > > to > > > > > > > > >>>> end the > > > > > > > > >>>> > startup call before making sure the server.isStarted() > > > > method > > > > > > > > returns > > > > > > > > >>>> true > > > > > > > > >>>> > on all servers. At that time, I introduced the > > > > > > > waitUntilServerStarts > > > > > > > > >>>> method > > > > > > > > >>>> > to make sure we don't return before the servers are > > ready. > > > > > > Turned > > > > > > > > >>>> out, that > > > > > > > > >>>> > was an incorrect way to handle this (We can blame > > > > > stackoverflow > > > > > > > for > > > > > > > > >>>> this > > > > > > > > >>>> > one!) and it is not enough that the server isStarted() > > > > returns > > > > > > > true. > > > > > > > > >>>> The > > > > > > > > >>>> > correct way to do this is to call the server.join() > > method > > > > > after > > > > > > > the > > > > > > > > >>>> > server.start(). > > > > > > > > >>>> > > > > > > > > > >>>> > See: > > > > > > > > >>>> > > > > > > > > > >>>> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > http://stackoverflow.com/questions/15924874/embedded-jetty-why-to-use-join > > > > > > > > >>>> > > > > > > > > > >>>> > This was equally satisfying as it was frustrating and > > you > > > > are > > > > > > > > welcome > > > > > > > > >>>> for > > > > > > > > >>>> > the future time I saved each of you :) > > > > > > > > >>>> > -- > > > > > > > > >>>> > Amoudi, Abdullah. > > > > > > > > >>>> > > > > > > > > > >>>> > > > > > > > > >>> > > > > > > > > >>> > > > > > > > > >>> > > > > > > > > >>> -- > > > > > > > > >>> Amoudi, Abdullah. > > > > > > > > >>> > > > > > > > > >> > > > > > > > > >> > > > > > > > > >> > > > > > > > > >> -- > > > > > > > > >> Amoudi, Abdullah. > > > > > > > > >> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > Amoudi, Abdullah. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > Amoudi, Abdullah. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > Amoudi, Abdullah. > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > Amoudi, Abdullah. > > > > > > > > > > > > > > > > -- > > > Raman > > > > > > > > > > > -- > > Amoudi, Abdullah. > > > > > > -- > Raman > -- Amoudi, Abdullah. --047d7b47252c268e1f051e1cb3f3--