Age | Commit message (Collapse) | Author | Files | Lines |
|
Children Ids must start at 1 as 0 represent the father.
Also fix callbacks that restart logs to use a procedd global variable that
holds the Id so that they work correctly both fot the parent process and the
children.
Signed-off-by: Andreas Schneider <asn@samba.org>
|
|
Signed-off-by: Andreas Schneider <asn@samba.org>
|
|
Signed-off-by: Andreas Schneider <asn@samba.org>
|
|
Pair-Programmed-With: Andreas Schneider <asn@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
|
|
We need to properly handle preforked children so it is better to just do that
automatically.
If the parent needs/wants to intercept SIGCHLD events it can set a callback
that will be called by the prefork code once the internal cleanup function that
checks all prefork children has been executed.
Signed-off-by: Andreas Schneider <asn@samba.org>
|
|
This way the parent doesn't need to know how to handle dead children and
keeps all of that within the prefork abstraction.
Signed-off-by: Andreas Schneider <asn@samba.org>
|
|
If this child has no clients, let the lock functions block for 1 second,
and then immediately reschedule the operation. This means we catch the lock
as soon as possible on a free child.
If, instead, we are already serving a client, we want to be non blocking,
so we timeout immediately on getting the lock, and then we sleep a 1/10th of
a second.
This means that a busy child will be slightly slower on picking up the lock,
but we won't block the existing client from communicating with us as we
immediately react to activity on the already opened file handler.
Signed-off-by: Andreas Schneider <asn@samba.org>
|
|
Signed-off-by: Andreas Schneider <asn@samba.org>
|
|
Signed-off-by: Andreas Schneider <asn@samba.org>
|
|
Signed-off-by: Andreas Schneider <asn@samba.org>
|
|
The allowed_clients var is a parent managed variable that tell children how
many clients they are allowed to handle at the same time. This way children
can overcommit but within parent controlled limits.
Signed-off-by: Andreas Schneider <asn@samba.org>
|
|
To get a client connection it is now possible to use asynchronous functions.
Signed-off-by: Andreas Schneider <asn@samba.org>
|
|
Primarily built for forked off rpc service daemons, but not tied to rpc
services and generic enough to be used elsewhere easily.
Signed-off-by: Andreas Schneider <asn@samba.org>
|