postgresql/src/include/utils
Alvaro Herrera f34c68f096 Introduce timeout handling framework
Management of timeouts was getting a little cumbersome; what we
originally had was more than enough back when we were only concerned
about deadlocks and query cancel; however, when we added timeouts for
standby processes, the code got considerably messier.  Since there are
plans to add more complex timeouts, this seems a good time to introduce
a central timeout handling module.

External modules register their timeout handlers during process
initialization, and later enable and disable them as they see fit using
a simple API; timeout.c is in charge of keeping track of which timeouts
are in effect at any time, installing a common SIGALRM signal handler,
and calling setitimer() as appropriate to ensure timely firing of
external handlers.

timeout.c additionally supports pluggable modules to add their own
timeouts, though this capability isn't exercised anywhere yet.

Additionally, as of this commit, walsender processes are aware of
timeouts; we had a preexisting bug there that made those ignore SIGALRM,
thus being subject to unhandled deadlocks, particularly during the
authentication phase.  This has already been fixed in back branches in
commit 0bf8eb2a, which see for more details.

Main author: Zoltán Böszörményi
Some review and cleanup by Álvaro Herrera
Extensive reworking by Tom Lane
2012-07-16 22:55:33 -04:00
..
.gitignore
acl.h Improve reporting of permission errors for array types 2012-06-15 22:55:03 +03:00
array.h Add array_remove() and array_replace() functions. 2012-07-11 13:59:35 -04:00
ascii.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
attoptcache.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
builtins.h Re-implement extraction of fixed prefixes from regular expressions. 2012-07-10 14:54:37 -04:00
bytea.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
cash.h
catcache.h Expose an API for calculating catcache hash values. 2012-03-07 14:51:13 -05:00
combocid.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
date.h Add transform functions for various temporal typmod coercisions. 2012-02-08 09:33:37 -05:00
datetime.h Improve EncodeDateTime and EncodeTimeOnly APIs 2012-03-14 23:03:34 +02:00
datum.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
dynahash.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
dynamic_loader.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
elog.h Mark ReThrowError() with attribute noreturn 2012-04-30 20:23:41 +03:00
fmgrtab.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
formatting.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
geo_decls.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
guc_tables.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
guc.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
help_config.h Unify calling conventions for postgres/postmaster sub-main functions 2012-06-25 21:30:12 +03:00
hsearch.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
inet.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
int8.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
inval.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
json.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
logtape.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
lsyscache.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
memutils.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
nabstime.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
numeric.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
palloc.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
pg_crc_tables.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
pg_crc.h Add const qualifiers where they are accidentally cast away 2012-02-28 12:42:08 +02:00
pg_locale.h Replace empty locale name with implied value in CREATE DATABASE and initdb. 2012-03-25 21:47:22 -04:00
pg_lzcompress.h
pg_rusage.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
plancache.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
portal.h Run a portal's cleanup hook immediately when pushing it to FAILED state. 2012-02-15 16:19:01 -05:00
ps_status.h
rangetypes.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
rbtree.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
rel.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
relcache.h Remove RELKIND_UNCATALOGED. 2012-06-14 09:47:30 -04:00
relmapper.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
reltrigger.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
resowner.h Add a small cache of locks owned by a resource owner in ResourceOwner. 2012-06-21 15:30:26 +03:00
selfuncs.h Refactor pattern_fixed_prefix() to avoid dealing in incomplete patterns. 2012-07-09 23:22:55 -04:00
snapmgr.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
snapshot.h Slightly reorganize struct SnapshotData. 2012-01-06 22:56:00 -05:00
sortsupport.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
spccache.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
syscache.h Expose an API for calculating catcache hash values. 2012-03-07 14:51:13 -05:00
timeout.h Introduce timeout handling framework 2012-07-16 22:55:33 -04:00
timestamp.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
tqual.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
tuplesort.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
tuplestore.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
typcache.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
tzparser.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
uuid.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
varbit.h Add a transform function for varbit typmod coercisions. 2012-02-07 12:42:50 -05:00
xml.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00