Skip to content

Commit 15939a7

Browse files
committed
Limit values of archive_timeout, post_auth_delay, auth_delay.milliseconds.
The previous definitions of these GUC variables allowed them to range up to INT_MAX, but in point of fact the underlying code would suffer overflows or other errors with large values. Reduce the maximum values to something that won't misbehave. There's no apparent value in working harder than this, since very large delays aren't sensible for any of these. (Note: the risk with archive_timeout is that if we're late checking the state, the timestamp difference it's being compared to might overflow. So we need some amount of slop; the choice of INT_MAX/2 is arbitrary.) Per followup investigation of bug #7670. Although this isn't a very significant fix, might as well back-patch.
1 parent 2e06d52 commit 15939a7

File tree

1 file changed

+2
-2
lines changed
  • src/backend/utils/misc

1 file changed

+2
-2
lines changed

src/backend/utils/misc/guc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,7 @@ static struct config_int ConfigureNamesInt[] =
12871287
GUC_UNIT_S
12881288
},
12891289
&XLogArchiveTimeout,
1290-
0, 0, INT_MAX, NULL, NULL
1290+
0, 0, INT_MAX / 2, NULL, NULL
12911291
},
12921292
{
12931293
{"post_auth_delay", PGC_BACKEND, DEVELOPER_OPTIONS,
@@ -1296,7 +1296,7 @@ static struct config_int ConfigureNamesInt[] =
12961296
GUC_NOT_IN_SAMPLE | GUC_UNIT_S
12971297
},
12981298
&PostAuthDelay,
1299-
0, 0, INT_MAX, NULL, NULL
1299+
0, 0, INT_MAX / 1000000, NULL, NULL
13001300
},
13011301
{
13021302
{"default_statistics_target", PGC_USERSET, QUERY_TUNING_OTHER,

0 commit comments

Comments
 (0)