🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #40681

Re: Diablo debugging problems...

#40681
From: Kjetil Torgrim Homme
Date: Fri, 08 Oct 1999 00:00
30 lines
2202 bytes
[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.

Technical Details
Message-ID: <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
References: <brad-0110991517500001@brad.techos.skynet.be> <brad-0510991348210001@brad.techos.skynet.be> <brad-0510991730300001@brad.techos.skynet.be> <37fa44dc$0$7740@news.execpc.com> <7tebo8$hta$1@zeus.fw.cuci.nl> <brad-0610991157590001@brad.techos.skynet.be> <ylpuysf23v.fsf@windlord.stanford.edu>

Show Full Headers
Complete Article Headers
Message-ID: <1rvh8i10op.fsf@haey.ifi.uio.no>
Subject: Re: Diablo debugging problems...
Date: Fri, 08 Oct 1999 00:00:00 +0000
From: Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no>
References: <brad-0110991517500001@brad.techos.skynet.be> <brad-0510991348210001@brad.techos.skynet.be> <brad-0510991730300001@brad.techos.skynet.be> <37fa44dc$0$7740@news.execpc.com> <7tebo8$hta$1@zeus.fw.cuci.nl> <brad-0610991157590001@brad.techos.skynet.be> <ylpuysf23v.fsf@windlord.stanford.edu>
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: 534303129
X-Complaints-To: usenet@maud.ifi.uio.no
X-Trace: maud.ifi.uio.no 939386694 11436 129.240.64.139 (8 Oct 1999 12:44:54 GMT)
Organization: Dept. of Informatics, University of Oslo, Norway
NNTP-Posting-Date: 8 Oct 1999 12:44:54 GMT
Newsgroups: news.software.nntp