diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2010-11-06 16:50:18 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2010-11-06 16:50:18 -0400 |
commit | dd1c781903811416db4e03383a4cb0bfc8cfac40 (patch) | |
tree | 95189e98f3f3663cfa4b4bf8904e36a1ca4aa4c8 /src/backend/utils/misc/guc.c | |
parent | 6736916f5f5a5f340aa20d4b27540764b5646585 (diff) |
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.
Diffstat (limited to 'src/backend/utils/misc/guc.c')
-rw-r--r-- | src/backend/utils/misc/guc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index b5dfa2287bb..09beb5f3985 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -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); } |