Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A23411016F for ; Mon, 12 Aug 2013 04:20:52 +0000 (UTC) Received: (qmail 80869 invoked by uid 500); 12 Aug 2013 04:20:51 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 80811 invoked by uid 500); 12 Aug 2013 04:20:51 -0000 Mailing-List: contact dev-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list dev@hive.apache.org Received: (qmail 80786 invoked by uid 99); 12 Aug 2013 04:20:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Aug 2013 04:20:49 +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 (athena.apache.org: domain of ghagleitner@hortonworks.com designates 209.85.212.53 as permitted sender) Received: from [209.85.212.53] (HELO mail-vb0-f53.google.com) (209.85.212.53) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Aug 2013 04:20:43 +0000 Received: by mail-vb0-f53.google.com with SMTP id i3so807797vbh.26 for ; Sun, 11 Aug 2013 21:20:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=ewwLez0Vz/UDWxdUBsytHsOAxBCU99ERtqMmciuK6So=; b=ZmzuOMut6/L9A/bfaZOutKO7qdLaYPBygLEb9ps/iGhMQUey6A9u5Smr/gm3jSc2CR j0yMndaIcp2YuqXEoqFs4LgPy7gppB+6wrkciZfOL4wn2HLWZaRG8/hKgpsGzo07WgSC rUR2YffhKQHIBEsxzvqePUwXJ7SwdfcDPGy5TZdxBRqqXIYbwXBMm1MYKNXRJtwYJxwU eE1yDqUVn5RO00BK8dJT2JmrJDbgY47Zxs5grSJ0rF0Q3ftKM2RP43+OnP0iu7/ipB4M TpK2u04sLnhSehN/10w00UOTxFVIgkBK4aUEL39jOnmU5dCrHJE+3lhIPhniQvgVs/Bz RCPw== X-Gm-Message-State: ALoCoQkB4UDdR3ZL+CG7rJZCloPlJvIQZ7hFgv+zZDGH7Hmo019nlVH95bWYSVK0TPqqkorkGY/j MIME-Version: 1.0 X-Received: by 10.52.187.162 with SMTP id ft2mr4447294vdc.10.1376281222193; Sun, 11 Aug 2013 21:20:22 -0700 (PDT) Received: by 10.58.211.161 with HTTP; Sun, 11 Aug 2013 21:20:22 -0700 (PDT) In-Reply-To: References: Date: Sun, 11 Aug 2013 21:20:22 -0700 Message-ID: Subject: Re: Discuss: End of static, thread local From: Gunther Hagleitner To: dev@hive.apache.org Content-Type: multipart/alternative; boundary=bcaec548a7af5c359e04e3b87162 X-Virus-Checked: Checked by ClamAV on apache.org --bcaec548a7af5c359e04e3b87162 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable +1 That's definitely the right way forward. These thread local variables should be verboten. I also agree with Brock's assessment that this will need a design doc first. My guess is that this will be quite a bit of work. Thanks, Gunther. On Sun, Aug 11, 2013 at 12:34 PM, Prasad Mujumdar wro= te: > +1 ! > That's should be the right approach IMO too. > > thanks > Prasad > > > > On Sun, Aug 11, 2013 at 10:03 AM, Brock Noland wrote= : > > > HIVE-4226 is a very welcome patch but in the long run I think we want t= o > > move away from using static thread local everywhere which that patch > uses. > > Rightfully so at this juncture. > > > > Meaning I think that HIVE-4226 is a good interim solution but long term= I > > think we want to be passing around some kind of context object as Edwar= d > > suggests in his original mail. This will make the code cleaner and more > > testable. > > > > This is a big effort and will require some analysis and planning before > > execution. > > > > > > On Sat, Aug 10, 2013 at 11:25 PM, Navis=EB=A5=98=EC=8A=B9=EC=9A=B0 wrote: > > > > > https://issues.apache.org/jira/browse/HIVE-4226 seemed addressing > this. > > > > > > 2013/8/11 Brock Noland : > > > > I would love to get rid of the static thread local stuff. It was > > required > > > > to make hive work in a server model but isn't the correct solution = to > > > this > > > > problem. > > > > > > > > I do think it will be a large amount of work so it'd be great to se= e > > > > whoever leads this effort to have a high level plan as opposed to a= n > > > adhoc > > > > effort. > > > > > > > > > > > > On Sat, Aug 10, 2013 at 12:32 PM, Edward Capriolo < > > edlinuxguru@gmail.com > > > >wrote: > > > > > > > >> I just committed https://issues.apache.org/jira/browse/HIVE-3772. > > > >> > > > >> For hive-server2 Carl and others did a lot of work to clean up un > > thread > > > >> safe things from hive. > > > >> > > > >> Hive was originally build as a fat client so it is not surprising > that > > > many > > > >> such constructs exist. Now since we have retrofitted > > multi-threaded-ness > > > >> onto the project we have a number of edge case bugs. > > > >> > > > >> My suggestions here would be for that the next release 0.13 we mak= e > a > > > push > > > >> to remove all possible non thread safe code and explicitly pass > > context > > > >> objects or serialized structures everywhere thread safety is neede= d. > > > >> > > > >> I can see this would start with something like the Function > Registry, > > > this > > > >> would be a per session object passed around rather then a global > > object > > > >> with static hashmap instances in it. > > > >> > > > >> I know that this probably will not be as simple as removing all > static > > > >> members from our codebase, but does anyone know of specific > challenges > > > that > > > >> will be intrinsically hard to solve? > > > >> > > > >> Please comment. > > > >> > > > > > > > > > > > > > > > > -- > > > > Apache MRUnit - Unit testing MapReduce - http://mrunit.apache.org > > > > > > > > > > > -- > > Apache MRUnit - Unit testing MapReduce - http://mrunit.apache.org > > > --bcaec548a7af5c359e04e3b87162--