httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@worldgate.com>
Subject Re: NSPR (was Re: rewritelog inefficiency)
Date Wed, 29 Apr 1998 06:15:30 GMT
On Tue, 28 Apr 1998, Dean Gaudet wrote:

> 
> 
> On Tue, 28 Apr 1998, Marc Slemko wrote:
> 
> > Hmm.  A write() can't be atomic if we catch a signal and get a partial
> > write with EINTR out of it, but writes to disk aren't slow system
> > calls so that can't happen in this case.
> 
> If a write() actually wrote something it always returns with the amount
> written, this is specified actually.  To do otherwise would be absolute
> chaos.  So if you're interrupted in a very large write, you won't see an
> EINTR, you'll just see a partial write.  That's why the loops for writing

But the problem is that you can't guarantee atomic writes if you can be
interrupted; yes you end up with a partial write, my wording was poor.  A
small slow write could actually see this a lot.

Writes to pipes are slow writes.  What (other than the reasonably low
chance of getting a signal and the low typical blocking length)  prevents
piped logs from screwing up by being interrupted?  If system calls aren't
automatically restarted, then you lose part of what you are logging.  If
they are restarted, it would probably end up not being atomic, which may
result in munged logs.

> in apache all test the r->connection->aborted... which is set by the
> SIGALRM handler during soft_timeouts.
> 
> > Does this stuff hold on Win32?
> 
> Very good question. 

I've always found it a pain you can't unlink a file then keep doing stuff
with the descriptor on Win32.  Sigh.  


Mime
View raw message