[squid-dev] Moved PID file management from Coordinator to Master

Amos Jeffries squid3 at treenet.co.nz
Wed Jan 14 09:25:55 UTC 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 14/01/2015 7:37 a.m., Tsantilas Christos wrote:
> On 01/12/2015 07:22 PM, Amos Jeffries wrote: On 12/01/2015 6:02
> a.m., Tsantilas Christos wrote:
>>>> Hi all, this patch moves pid file managment from coordinator 
>>>> process to master process.
>>>> 
>>>> This move is the first step necessary to avoid the following
>>>> race condition among PID file deletion and shared segment 
>>>> creation/destruction in SMP Squid:
>>>> 
>>>> O1) The old Squid Coordinator removes its PID file and quits.
>>>> N1) The system script notices Coordinator death and starts
>>>> the new Squid. N2) Shared segments are created by the new
>>>> Master process. O2) Shared segments are removed by the old
>>>> Master process. N3) New worker/disker processes fail due to
>>>> missing segments.
>>>> 
> 
> The Coordinator needs to continue coordinating activities over the
> SMP sockets until the workers are all shutdown and SMP sockets
> closed, only then should it do O2 and O1 (in that order).
> 
> The planned behaviour for worker shutdown is to: W1) early client
> FD closures into the beginning of the shutdown_timeout period W2)
> on each client closure or connection going idle, close it W3) at
> end of shutdown_timeout OR last client disconnect, release all 
> resources.
> 
> In that design the AsyncEngine still runs right up until the queue 
> completes draining. Using SMP sockets to inform Coordinator about 
> clean shutdown at the end.
> 
>> My sense is that the exit status can provide the same
>> functionality and also is easier to be implemented. If the worker
>> aborted early by a segfault then I am doubt that it will be able
>> to send a message to an SMP socket.
> 
> The Master process has no way to know if the workers are exiting
> early with no clients, or aborting on worker-specific
> shutdown_timeout values. But the coordinator can receive a
> terminated message from them over SMP sockets.
> 
>> We can use exit status.

Does the master process get exit status of *all* worker processes and
the sub-childs down N levels? It was my understanding that in SMP each
worker disker etc is a fork() and the child becomes new coordinator.


Amos
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (MingW32)

iQEcBAEBAgAGBQJUtjYjAAoJELJo5wb/XPRjWN0IAJUR13a2a45DT/XKqlYVYXGb
BoqPtKRUQQQsSrAqxJVrl59UXgY+yB38h7QWUrdBUV/+QaZvEhjMwVSLsL8qHbrM
bMd0HQLa5G8W9nuKQnuI+3iwUQj0F9+7Z45yGKFimJRi7sDGRkHH5dTl/zJqNLgu
oYJYZ3nB6QYsLV15SVf/cpBxrhELKZCfvb5Fcoy8LZojUfK9O0gXmdmBIJJtJyoa
1u9TbKsxtAdJOiUuhGcruLApj2bHoQL6IwEm9soV2IYOUxCamFKyaz4BqmUzmp05
txaYvQ3GbMc9k5IGGuXZHNiEVyNjUSg/97qXL150lYpKu7IYCJXqCj4PqwMu7NU=
=qDv3
-----END PGP SIGNATURE-----


More information about the squid-dev mailing list