From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19776 invoked from network); 17 May 2002 17:33:21 -0000 Received: from unknown (HELO fencepost.gnu.org) (199.232.76.164) by sources.redhat.com with SMTP; 17 May 2002 17:33:21 -0000 Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 178lbD-0000eG-00; Fri, 17 May 2002 13:33:03 -0400 Received: from natint.juniper.net ([207.17.136.129] helo=merlot.juniper.net) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 178lZU-0000QS-00 for ; Fri, 17 May 2002 13:31:16 -0400 Received: from juniper.net (pptp036.static.jnpr.net [172.24.248.36]) by merlot.juniper.net (8.11.3/8.11.3) with ESMTP id g4HHVBR41669; Fri, 17 May 2002 10:31:12 -0700 (PDT) (envelope-from dirk@juniper.net) Message-ID: <3CE53E5E.2080402@juniper.net> From: Dirk Bergstrom Organization: software tools User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0rc2) Gecko/20020510 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Lars Henriksen CC: Mel Hatzis , help-gnats@gnu.org Subject: Re: use of GNATSDB References: <3CA28C27.6010201@juniper.net> <20020517120308.GA1524344@cluster2.netman.dk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: help-gnats-admin@gnu.org Errors-To: help-gnats-admin@gnu.org X-BeenThere: help-gnats@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: General discussion about GNU GNATS List-Archive: Date: Fri, 17 May 2002 10:33:00 -0000 X-SW-Source: 2002-q2/txt/msg00048.txt.bz2 On 5/17/2002 5:03 AM, this issued forth from the mind of Lars Henriksen: > I can't reproduce this behaviour. Whether GNATSDB is set or not, the command > "pr-edit --lockdb" seems to lock nothing at all. Neither does "pr-edit > --database= --lockdb". On the other hand, "pr-edit --lock " > honors GNATSDB as well as the --database option. this is a totally different issue. as you probably know, gnats has two separate code paths: "localhost mode", in which the particular program you're running directly interacts with the database. "network mode" in which the program talks to gnatsd over a socket. i could rant extensively about how foolish, wasteful & bug-prone this is, but i'll save that for another day, and stick to this particular example of the folly. so in pr-edit, the "network mode" lockdb code opens a socket to gnatsd and issues a LKDB command, and gnatsd locks the database. in "localhost mode", pr-edit makes a call to gnats_lock() (actually, it calls foo, which calls bar, which calls gnats_lock), which is the same call that gnatsd makes. this *does* lock the database, but then, at the very end of main(), there's a check that says something like: if (gnats_locked) { unlock_gnats() } this check is entirely reasonable, if you're trying to do an edit, or an append, but it's just wrong if you're trying to lock the database. so, you happen to have run into one of the many, many subtle and outrageous bugs in localhost mode. this is why i counsel people to *always* use network mode, even when talking to a local database. how, you ask, do you make sure you're using network mode? by specifying either --host or --port or both. -- Dirk Bergstrom dirk@juniper.net Computer Geek v: 707.433.0564 Juniper Networks Inc. f: 707.433.0769 "it *looks* like a nail; lemme grab my hammer..." _______________________________________________ Help-gnats mailing list Help-gnats@gnu.org http://mail.gnu.org/mailman/listinfo/help-gnats