httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@worldgate.com>
Subject Re: fcntl() errors on Solaris
Date Wed, 13 Aug 1997 01:30:25 GMT
On Tue, 12 Aug 1997, Alexei Kosut wrote:

> I've been seeing this pretty consistently over the past few weeks: Since
> I'm use Apache mostly for development (of Apache and related bits), I
> start and stop Apache a lot; dozens of times an hour. After a five or six
> hours, I always manage to get it so Apache no longer works right; it only
> forks one or two children, instead of the five I have set, and I get tons
> of these in my error log:
> 
> [Tue Aug 12 17:41:29 1997] fcntl: F_SETLKW: No record locks available
> [Tue Aug 12 17:41:29 1997] - Error getting accept lock. Exiting!
> 
> I'm using Solaris 2.5.1, and I'm presuming this is because Apache uses
> fcntl for its accept_mutex to lock a file, and then exists (see my
> earlier message about how sig_term() works, and why it sucks) without
> unlocking the file. All those locked files add up, I guess.
> 
> If I leave it overnight, and come back, it works again for a while.
> 
> Oh, and the files are being locked over NFS. That possibly has something
> to do with it.
> 
> Still, Apache should make sure it unlocks its accept mutex before it
> quits. I think the children do the right thing wrt mutexes when they are
> restarted, though I'm not sure. I'm sure, however, that a shutdown
> (SIGTERM) does the wrong thing.

NFS locking isn't, which is probably the biggest reason for your troubles.

In any case, when a process terminates all its locks are released.
When a descriptor is closed, all locks are released.  In
fact, they are released even if you don't want them to be; eg. open
a descriptor, dup() it, close the dup()ed descriptor and the lock
goes away.  If Solaris doesn't behave this way it is broken.  Well...
we know it is broken.  But then it is really broken.  

Did you try using flock?  May need to use libucb which messes some
things up at times.


Mime
View raw message