djbdns
[Top] [All Lists]

Re: Too many open files tinydns?

To: "Vincent Labrecque" <vnc@hush.ai>
Subject: Re: Too many open files tinydns?
From: "Shaun" <mailinglists@unix-scripts.com>
Date: Sat, 18 Nov 2006 14:04:08 -0800
Cc: <dns@list.cr.yp.to>
Delivered-to: sp-com-lists@consult.net
Delivered-to: gmail-djbdns@securepoint.com
Delivered-to: sp.com.list@gmail.com
Delivered-to: mailing list dns@list.cr.yp.to
Mailing-list: contact dns-help@list.cr.yp.to; run by ezmlm
References: <20061118175108.1417DDA829@mailserver7.hushmail.com>
A `svc -d .;svc -u .` corrects the problem, why cant the patch just re-initiate tinydns to correct the problem it self?

My understanding is this patch is going to just tell us what you already know but is this going to somehow shed light on where the problem is so it can be corrected? I could understand if the file was corrupted that it could cause a problem but a simple restart fixes the issue with out me rebuilding the cdb file. I do have a exporter process that runs every 5 minutes updating the cdb file from a database, i would assume that maybe tinydns is re-reading that file possibly while it's being updated?

~Shaun
----- Original Message ----- From: "Vincent Labrecque" <vnc@hush.ai>
To: "Shaun" <mailinglists@unix-scripts.com>
Sent: Saturday, November 18, 2006 9:51 AM
Subject: Re: Too many open files tinydns?


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

of course i just had to tell you that I didn't understand to
suddently understand.

here's the diff, in case you want to try it.  reporting the actual
errors would probably be appropriate, and it will make djbdns log
on every error, but it is a step in the right direction.

note that it won't respond to requests any more than before - it is
unable to read the CDB file containing the tinydns data! arguably
this diff is useless. it will at least make the strace logs easier
to understand.

- --Vincent

diff -u djbdns-1.05/tdlookup.c djbdns-1.05-p/tdlookup.c
- --- djbdns-1.05/tdlookup.c      2001-02-11 16:11:45.000000000 -0500
+++ djbdns-1.05-p/tdlookup.c    2006-11-16 12:00:09.000000000 -0500
@@ -298,9 +298,17 @@
  if (!r) r = cdb_find(&c,key,4);
  if (!r) r = cdb_find(&c,key,3);
  if (!r) r = cdb_find(&c,key,2);
- -  if (r == -1) return 0;
+  if (r == -1) {
+    cdb_free(&c);
+    close(fd);
+    return 0;
+  }
  if (r && (cdb_datalen(&c) == 2))
- -    if (cdb_read(&c,clientloc,2,cdb_datapos(&c)) == -1) return 0;
+    if (cdb_read(&c,clientloc,2,cdb_datapos(&c)) == -1) {
+      cdb_free(&c);
+      close(fd);
+      return 0;
+    }

  r = doit(q,qtype);

-----BEGIN PGP SIGNATURE-----
Note: This signature can be verified at https://www.hushtools.com/verify
Version: Hush 2.5

wpwEAQECAAYFAkVfSAsACgkQsBV9fcPttKC/hgQAkXIBLggzyX2JZeGOvJvAs78M0Y5v
s21gIE9n0wPVo0P4cCk22PoOlBKArv1EaeEDFOLkG7B/3PEc7gGH8+qHaRYJakEFrRQf
89g2ncuUZ+qKIYs2tWtWv1SGnvy5M65alK95leDKjkkgu60HkR7BjTozRvU+kmBTfwbx
MoS/60c=
=diiu
-----END PGP SIGNATURE-----





<Prev in Thread] Current Thread [Next in Thread>