9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] lsub.org
Date: Mon, 13 Aug 2007 07:56:30 -0400	[thread overview]
Message-ID: <9a5d188e7b220e2d8ce41bf79f8081b6@quanstro.net> (raw)
In-Reply-To: <599f06db0708122047p67c975a6y1f355eb0cdf767e5@mail.gmail.com>

assuming things are broken without external help ....

i've been having trouble with dns infinitely extending
the life of queries when a "srvfail" is returned by an authoratitive
server.  eventually one query to a broken ns will hold up all the threads available
on the server.  this happends a lot on reverse lookups.  i fire this script
every 10 minutes to help ease the pain until i have the time figure out exactly
what's going wrong.

- erik

#!/bin/rc
rfork en
mailuser=guywhogetstocheckonthisstuff
fflag=0
nl='
'
fn usage{
	echo 'usage: restartdns [-f]' >[1=2]
	exit usage
}

fn why{
	if(! ~ $#nbroken 0)
		echo getting mediæval on $#nbroken broken dns processes.
	if not{
		echo getting mediæval on $#nwait deadlocked dns processes.
		for(i in $nwait)
			echo $i
	}
}

for(i)switch($i){
case -f
	fflag=1
case *
	usage
}

if(~ $fflag 0){
	nbroken=`{ps -a | grep dns | grep Broken}
	ifs=$nl nwait=`{ps -a |sed -n 's/.* +dns \[query lock wait for(.*)\]/\1/gp' | sort | uniq -c | awk '$1>2'}

	if(~ $#nbroken 0 && ~ $#nwait 0)
		exit 'none broken'
	why
	if(~ $service rx)
		{date; echo; why; echo; ps -a | grep dns}| mail $guywhogetstocheckonthisstuff
}

slay dns | rc
ndb/dns -s
ndb/dns -Rrsx /net.alt -f /lib/ndb/external


  reply	other threads:[~2007-08-13 11:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-13  3:25 ron minnich
2007-08-13  3:47 ` Gorka Guardiola
2007-08-13 11:56   ` erik quanstrom [this message]
2007-08-13 12:03     ` erik quanstrom
2007-08-13 13:39     ` Francisco J Ballesteros
2007-08-13 14:34       ` Francisco J Ballesteros
2007-08-13 18:29     ` geoff
2007-08-13 18:44       ` erik quanstrom
2007-08-13 19:11       ` erik quanstrom
2007-08-13 22:12         ` geoff
2007-08-14 16:55           ` erik quanstrom
2007-08-14 21:28             ` Artem Letko
2007-08-14 21:52               ` erik quanstrom
2007-08-14 22:07                 ` Artem Letko

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=9a5d188e7b220e2d8ce41bf79f8081b6@quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@cse.psu.edu \
    /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 NNTP newsgroup(s).