Skip site navigation (1) Skip section navigation (2)

pgsql: Assert that WaitLatch's timeout is not more than INT_MAXmillise

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Assert that WaitLatch's timeout is not more than INT_MAXmillise
Date: 2012-11-18 20:40:02
Message-ID: E1TaBes-0003KL-99@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Assert that WaitLatch's timeout is not more than INT_MAX milliseconds.

The behavior with larger values is unspecified by the Single Unix Spec.
It appears that BSD-derived kernels report EINVAL, although Linux does not.
If waiting for longer intervals is desired, the calling code has to do
something to limit the delay; we can't portably fix it here since "long"
may not be any wider than "int" in the first place.

Part of response to bug #7670, though this change doesn't fix that
(in fact, it converts the problem from an ERROR into an Assert failure).
No back-patch since it's just an assertion addition.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/14ddff44c22cb358775d5aad6953f0ce0fdb64cf

Modified Files
--------------
src/backend/port/unix_latch.c  |   10 ++++++----
src/backend/port/win32_latch.c |    3 ++-
2 files changed, 8 insertions(+), 5 deletions(-)

pgsql-committers by date

Next:From: Tom LaneDate: 2012-11-18 21:17:00
Subject: pgsql: Fix syslogger to not fail when log_rotation_age exceeds 2^31mil
Previous:From: User FxjrDate: 2012-11-18 14:23:49
Subject: npgsql - Npgsql2: Fixed possible datareader leak if the test fail.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group