Article View: news.software.nntp
Article #40677Re: Diablo debugging problems...
From: Joe Greco
Date: Fri, 08 Oct 1999 00:00
Date: Fri, 08 Oct 1999 00:00
48 lines
3218 bytes
3218 bytes
In news.software.nntp article <1rvh8i10op.fsf@haey.ifi.uio.no>, Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> wrote: :[Russ Allbery] : :> Brad Knowles <brad@shub-internet.org> writes: :> :> > This is very close to the xwrite() routine that Joe posted, but :> > neither of these take into account the fact that you should only :> > go through this loop so many times before you drop out. If you :> > don't have a method of giving up when things get hopelessly :> > slow, you can bog down the whole system waiting on a single :> > write() to complete. :> :> Well, to be fair, I've never seen that behavior from write(), so I :> think you may be worrying about an error condition that never :> happens in practice. But it's a point, and it's theoretically :> possible I suppose. : :A loop with ENOSPC or EBADF (a bug elsewhere in the code) can happen. :I think the correct approach is to retry if EAGAIN, and propagate :other errors back to the caller. It may also be useful to call :abort() outright when you get an EBADF. This means that the caller no :longer needs to check for partial writes, but still have to handle :errors like disk full[1]. : :Kjetil T. : :[1] You can get a partial write in this case, but the code to handle :disk full properly is usually complex anyhow. I'd never seen a disk full error on a pipe, so the code I gave Brad didn't even attempt to deal with it. Again, I _only_ meant the code as a quick way for Brad to verify whether or not it was a short write problem that was getting him. I wrote the code I meant it to be integrated into, and deemed it sufficient for providing the information I wanted to know. Now, in the case of a generic news system, yes, you could handle disk full and situations like that in a variety of ways. I believe Diablo does so by truncating the file back to where it was (safe under the Diablo storage paradigm), but one could make a case for sitting in a loop like xwrite, with a "if disk full then sleep(30)" in there, since Diablo clears disk space asynchronously - and the current behaviour is actually a bit on the exasperating side. But I think we agree that this is really more of an application level issue, and that any "wrapper" functions like these are really not very useful bandaids. ... JG
Technical Details
Message-ID:
<37fe0f51$0$11276@news.execpc.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<brad-0110991517500001@brad.techos.skynet.be> <brad-0610991157590001@brad.techos.skynet.be> <ylpuysf23v.fsf@windlord.stanford.edu> <1rvh8i10op.fsf@haey.ifi.uio.no>Show Full Headers
Complete Article Headers
Message-ID: <37fe0f51$0$11276@news.execpc.com> Subject: Re: Diablo debugging problems... Date: Fri, 08 Oct 1999 00:00:00 +0000 From: jgreco@ns.sol.net (Joe Greco) References: <brad-0110991517500001@brad.techos.skynet.be> <brad-0610991157590001@brad.techos.skynet.be> <ylpuysf23v.fsf@windlord.stanford.edu> <1rvh8i10op.fsf@haey.ifi.uio.no> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 534356686 Sender: jgreco@earth.execpc.com X-Trace: S=T[4Gb?NPAI5[332>a9YKbfNiaEHUgJGRYcgIRLSUEMVM=S5P;4D\I_MnD[7d7]KFHFnVQ;I2EDGGhaMU<hZ^NGF4FfQ?Mh6UM Organization: sol.net Network Services - Milwaukee, WI Newsgroups: news.software.nntp X-Complaints-To: abuse@execpc.com