Re: fork/exec patch: pre-CreateProcess finalization - Mailing list pgsql-patches

From Tom Lane
Subject Re: fork/exec patch: pre-CreateProcess finalization
Date
Msg-id 21143.1073628931@sss.pgh.pa.us
Whole thread Raw
In response to Re: fork/exec patch: pre-CreateProcess finalization  (Claudio Natoli <claudio.natoli@memetrics.com>)
List pgsql-patches
Claudio Natoli <claudio.natoli@memetrics.com> writes:
> Tom Lane wrote:
>> I think the simplest way to make this work is to use an array that's
>> 2*MaxBackend items long (corresponding to the max number of children the
>> postmaster will fork).

> Actually, now that I think about it, is even that big enough. There is a
> reason BackendList is a list. In pathological situations, the postmaster
> could be made to fork a much larger number than 2*MaxBackend simultaneous
> children, although only this many will be allowed to become backends.
> (I guess we could check the port->canAcceptConnections value, and not add
> the backend to the array when == CAC_TOOMANY).

Probably we could rearrange the logic to test for too-many-children
before we even do the fork.  It'd be a little uglier that way, but
not out of the question.

            regards, tom lane

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: fork/exec patch: pre-CreateProcess finalization
Next
From: Tom Lane
Date:
Subject: Re: fork/exec patch: pre-CreateProcess finalization