public inbox for gnats-devel@sourceware.org
 help / color / mirror / Atom feed
From: "Jim Searle" <jims@broadcom.com>
To: bug-gnats@gnu.org
Cc: help-gnats@gnu.org
Subject: RE: gnatsd Too many open files error
Date: Wed, 07 Apr 2004 18:51:00 -0000	[thread overview]
Message-ID: <029301c41cd0$5a6dff30$2c88030a@LTIRVAJIMS3> (raw)
In-Reply-To: <026e01c41cc9$7db896f0$2c88030a@LTIRVAJIMS3>


[-- Attachment #1.1: Type: text/plain, Size: 2407 bytes --]

The attached patch fixes my problem.

-----Original Message-----
From: bug-gnats-bounces+jims=broadcom.com@gnu.org
[mailto:bug-gnats-bounces+jims=broadcom.com@gnu.org] On Behalf Of Jim Searle
Sent: Wednesday, April 07, 2004 10:55 AM
To: bug-gnats@gnu.org
Cc: help-gnats@gnu.org
Subject: RE: gnatsd Too many open files error


I CC'ed hep-gnats since I've received no response from bug-gnats...
 
It seems that gnatsd never closes the PR.lock file, an strace of the REPL
command shows this:
open("/tools/gnats/4.0/etc/gnats/db-vlsibcmx/gnats-adm/gnats.lock",
O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, 0) = 5
open("/tools/gnats/4.0/etc/gnats/db-vlsibcmx/gnats-adm/index", O_RDONLY) = 6
close(6)                                = 0
open("/tools/gnats/4.0/etc/gnats/db-vlsibcmx/gnats-adm/locks/3515.lock",
O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, 0644) = 6
close(6)                                = 0
open("/tools/gnats/4.0/etc/gnats/db-vlsibcmx/test/3515", O_RDONLY) = 6
close(6)                                = 0
open("/tools/gnats/4.0/etc/gnats/db-vlsibcmx/test/3515", O_RDONLY) = 6
close(6)                                = 0
open("/tools/gnats/4.0/etc/gnats/db-vlsibcmx/test/3515", O_RDONLY) = 6
close(6)                                = 0
open("/tools/gnats/4.0/etc/gnats/db-vlsibcmx/test/3515",
O_RDWR|O_CREAT|O_TRUNC, 0666) = 6
close(6)                                = 0
unlink("/tools/gnats/4.0/etc/gnats/db-vlsibcmx/test/3515.old") = 0
open("/tools/gnats/4.0/etc/gnats/db-vlsibcmx/gnats-adm/indI6fqXL",
O_RDWR|O_CREAT|O_EXCL, 0600) = 6
close(6)                                = 0
unlink("/tools/gnats/4.0/etc/gnats/db-vlsibcmx/gnats-adm/locks/3515.lock") =
0
unlink("/tools/gnats/4.0/etc/gnats/db-vlsibcmx/gnats-adm/gnats.lock") = 0


-----Original Message-----
From: bug-gnats-bounces+jims=broadcom.com@gnu.org
[mailto:bug-gnats-bounces+jims=broadcom.com@gnu.org] On Behalf Of Jim Searle
Sent: Tuesday, April 06, 2004 3:23 PM
To: bug-gnats@gnu.org
Subject: gnatsd Too many open files error


If during a single gnatsd session I modify a field for a bunch of PR's, on
change number 252 I get this error:
 
640 Cannot create lock file
/tools/gnats/4.0/etc/gnats/db-vlsibcmx/gnats-adm/locks/1579.lock: Too many
open files
 
My simple command file is:
CHDB someDB someUser thePassword
REPL 1579 Priority
low
.

with the last 3 lines repeated 252 times.
 


[-- Attachment #1.2: Type: text/html, Size: 5726 bytes --]

[-- Attachment #2: patch_internal_1 --]
[-- Type: application/octet-stream, Size: 1196 bytes --]

*** internal.c  Wed Apr  7 11:11:13 2004
--- ../../gnats-4.0-Linux/gnats/internal.c      Wed Nov  5 20:04:08 2003
***************
*** 117,126 ****
  lock_gnats (const DatabaseInfo database, ErrorDesc *err)
  {
    char *path;
!   int count, res, fdes;
    const int MAXWAIT = 10;
    const int GRANULARITY = 1;
!   
    path = gnats_adm_dir (database, "gnats.lock");
  
  
--- 117,126 ----
  lock_gnats (const DatabaseInfo database, ErrorDesc *err)
  {
    char *path;
!   int count, res;
    const int MAXWAIT = 10;
    const int GRANULARITY = 1;
! 
    path = gnats_adm_dir (database, "gnats.lock");
  
  
***************
*** 129,139 ****
      {
        errno = 0;
        /* use atomic create, to avoid races */
!       fdes = open (path, O_CREAT | O_TRUNC | O_WRONLY | O_EXCL, 0);
!       if (fdes != -1)
        {
          /* success */
-           close(fdes);
          break;
        }
        else
--- 129,137 ----
      {
        errno = 0;
        /* use atomic create, to avoid races */
!       if (open (path, O_CREAT | O_TRUNC | O_WRONLY | O_EXCL, 0) != -1)
        {
          /* success */
          break;
        }
        else

[-- Attachment #3: Type: text/plain, Size: 139 bytes --]

_______________________________________________
Help-gnats mailing list
Help-gnats@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnats

      reply	other threads:[~2004-04-07 18:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <011401c41c25$a94e86c0$2c88030a@LTIRVAJIMS3>
2004-04-07 18:06 ` Jim Searle
2004-04-07 18:51   ` Jim Searle [this message]

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='029301c41cd0$5a6dff30$2c88030a@LTIRVAJIMS3' \
    --to=jims@broadcom.com \
    --cc=bug-gnats@gnu.org \
    --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).