Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-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 BF6EE43B3 for ; Wed, 15 Jun 2011 09:47:55 +0000 (UTC) Received: (qmail 22601 invoked by uid 500); 15 Jun 2011 09:47:55 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 22566 invoked by uid 500); 15 Jun 2011 09:47:55 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 22558 invoked by uid 99); 15 Jun 2011 09:47:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jun 2011 09:47:55 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fdmanana@gmail.com designates 74.125.83.180 as permitted sender) Received: from [74.125.83.180] (HELO mail-pv0-f180.google.com) (74.125.83.180) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jun 2011 09:47:49 +0000 Received: by pvc21 with SMTP id 21so174620pvc.11 for ; Wed, 15 Jun 2011 02:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=RXZLWjgzRByN6K67H9bLRxxW+c5ehtvT3GIU2m+F1kM=; b=oeOiCYm9o/TRjQmPs0v/c4DVLfzyh6X8HVhrRyVHYIdInb0RT/fsKgFnvt1urTsugy 3PVcO09aQNytbD1OgXklADJw2mf/LDbPHzrZHmFul4HYJGZowTQ9uW3bJZWwz8W44RXj gzqLfK43yOR9TswC7ZKkQAo8VaejFwTf7vTXM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=vh/DBD5GvYjIZJabiT+iayB47zImcOP9Qi6zCTt/LAjP4SH4SC7QhPF4W3L9AsZ8py uC/zXt0h7Xw6QNLYNRhmt9MogGm3da4Q7V3CDDvwE2I615oI7J7M31WlRtQ90ENDfJrg 1UyDjfTF5gQIzL7FPznGcq23Jbej2ZUXccYb0= MIME-Version: 1.0 Received: by 10.68.0.226 with SMTP id 2mr123549pbh.212.1308131247680; Wed, 15 Jun 2011 02:47:27 -0700 (PDT) Sender: fdmanana@gmail.com Received: by 10.68.64.202 with HTTP; Wed, 15 Jun 2011 02:47:27 -0700 (PDT) In-Reply-To: References: Date: Wed, 15 Jun 2011 10:47:27 +0100 X-Google-Sender-Auth: u3uwS-9lUXaO-oED7oyRMZGsyyA Message-ID: Subject: Re: couch_server.erl - is couch_dbs_by_name table correclty used in terminate() function ? From: Filipe David Manana To: dev@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org It seems to me you're right about it. Do you want to provide a small patch to fix it? (Ideally in a Jira ticket) Thanks Andrey On Wed, Jun 15, 2011 at 10:30 AM, Andrey Somov wrote: > Hi all, > when I read the code in couch_server.terminate() function I see the > following in the trunk: > > terminate(_Reason, _Srv) -> > =C2=A0 =C2=A0[couch_util:shutdown_sync(Pid) || {_, {Pid, _LruTime}} <- > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ets:tab2list(couch_dbs_by_name)]= , > =C2=A0 =C2=A0ok. > > It looks like the values in the couch_dbs_by_name table are tuples of 2 > terms. > But when I read the rest of the code I see that the values are always > 3-term-tuples: > > {opened, Pid, LruTime} or {opening, Opener, [Froms]} > > I must admit I do not understand how the code in the terminate() may work= . > Is it just a bug ? > > > - > Andrey > --=20 Filipe David Manana, fdmanana@gmail.com, fdmanana@apache.org "Reasonable men adapt themselves to the world. =C2=A0Unreasonable men adapt the world to themselves. =C2=A0That's why all progress depends on unreasonable men."