1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Make get_stack_depth_rlimit() handle RLIM_INFINITY more sanely.

Rather than considering this result as meaning "unknown", report LONG_MAX.
This won't change what superusers can set max_stack_depth to, but it will
cause InitializeGUCOptions() to set the built-in default to 2MB not 100kB.
The latter seems like a fairly unreasonable interpretation of "infinity".
Per my investigation of odd buildfarm results as well as an old complaint
from Heikki.

Since this should persuade all the buildfarm animals to use a reasonable
stack depth setting during "make check", revert previous patch that dumbed
down a recursive regression test to only 5 levels.
This commit is contained in:
Tom Lane
2010-11-06 16:50:18 -04:00
parent 6736916f5f
commit dd1c781903
4 changed files with 12 additions and 8 deletions

View File

@ -3485,14 +3485,14 @@ InitializeGUCOptions(void)
stack_rlimit = get_stack_depth_rlimit();
if (stack_rlimit > 0)
{
int new_limit = (stack_rlimit - STACK_DEPTH_SLOP) / 1024L;
long new_limit = (stack_rlimit - STACK_DEPTH_SLOP) / 1024L;
if (new_limit > 100)
{
char limbuf[16];
new_limit = Min(new_limit, 2048);
sprintf(limbuf, "%d", new_limit);
sprintf(limbuf, "%ld", new_limit);
SetConfigOption("max_stack_depth", limbuf,
PGC_POSTMASTER, PGC_S_ENV_VAR);
}