monit-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: monit ./getloadavg.c ./monitor.c ./monitor.h ./...


From: Jan-Henrik Haukeland
Subject: Re: monit ./getloadavg.c ./monitor.c ./monitor.h ./...
Date: Wed, 17 Sep 2003 20:23:19 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Reasonable Discussion, linux)

Martin Pala <address@hidden> writes:


>       Change the mechanism for closing inherited filedescriptors. Sockets now 
> have
>       FD_CLOEXEC flag turned on, which causes its closure on exec 
> (filedescriptors
>       are not inherited). The section between open/accept/socket and fcntl is
>       critical => it is protected by mutex - in the case that monit will to do
>       first fork() in spawn(), it must obtain the mutex to ensure that there 
> is
>       no unprotected socket.
>       
>       Monit no longer closes filedescriptors in the style:
>       
>       for(i= 3; i< max_descriptors; i++) close(i);

Hmm, the mutex in the httpd thread is not necessary! The control is
serialized since there is only one thread and only one thread that can
call accept! FD_CLOEXEC is fine, since the client can call spawn.

Please reconsider this patch, especially mutex-lock over a fork looks
ugly. As I said, I do not think file descriptors was and will be the
original problem for the Assert Exception you reported.

-- 
Jan-Henrik Haukeland




reply via email to

[Prev in Thread] Current Thread [Next in Thread]