public inbox for gnats-devel@sourceware.org
 help / color / mirror / Atom feed
From: Dirk Bergstrom <dirk@juniper.net>
To: Lars Henriksen <Lars.Henriksen@netman.dk>
Cc: Mel Hatzis <hatzis@juniper.net>, help-gnats@gnu.org
Subject: Re: use of GNATSDB
Date: Fri, 17 May 2002 10:33:00 -0000	[thread overview]
Message-ID: <3CE53E5E.2080402@juniper.net> (raw)
In-Reply-To: <20020517120308.GA1524344@cluster2.netman.dk>

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=<db> --lockdb". On the other hand, "pr-edit --lock <user> <PR>"
> 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

  parent reply	other threads:[~2002-05-17 17:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-27 19:24 Mel Hatzis
     [not found] ` <15525.34645.542865.70528@habakuk.home.ha-schneider.de>
     [not found]   ` <3CA6046B.1060004@juniper.net>
     [not found]     ` <15528.10405.211358.551224@habakuk.home.ha-schneider.de>
2002-04-30 22:18       ` Mel Hatzis
2002-05-17  5:06 ` Lars Henriksen
2002-05-17  5:24   ` Lars Henriksen
2002-05-17  5:30     ` Lars Henriksen
2002-05-17 11:09       ` Mel Hatzis
2002-05-17 11:33         ` Lars Henriksen
2002-05-17 10:33   ` Dirk Bergstrom [this message]
2002-05-17 11:15     ` Lars Henriksen
2002-05-17 11:21       ` Dirk Bergstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3CE53E5E.2080402@juniper.net \
    --to=dirk@juniper.net \
    --cc=Lars.Henriksen@netman.dk \
    --cc=hatzis@juniper.net \
    --cc=help-gnats@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).