PostgreSQL Source Code git master
|
#include "datatype/timestamp.h"
Go to the source code of this file.
Data Structures | |
struct | EnableTimeoutParams |
struct | DisableTimeoutParams |
Typedefs | |
typedef enum TimeoutId | TimeoutId |
typedef void(* | timeout_handler_proc) (void) |
typedef enum TimeoutType | TimeoutType |
Enumerations | |
enum | TimeoutId { STARTUP_PACKET_TIMEOUT , DEADLOCK_TIMEOUT , LOCK_TIMEOUT , STATEMENT_TIMEOUT , STANDBY_DEADLOCK_TIMEOUT , STANDBY_TIMEOUT , STANDBY_LOCK_TIMEOUT , IDLE_IN_TRANSACTION_SESSION_TIMEOUT , TRANSACTION_TIMEOUT , IDLE_SESSION_TIMEOUT , IDLE_STATS_UPDATE_TIMEOUT , CLIENT_CONNECTION_CHECK_TIMEOUT , STARTUP_PROGRESS_TIMEOUT , USER_TIMEOUT , MAX_TIMEOUTS = USER_TIMEOUT + 10 } |
enum | TimeoutType { TMPARAM_AFTER , TMPARAM_AT , TMPARAM_EVERY } |
Functions | |
void | InitializeTimeouts (void) |
TimeoutId | RegisterTimeout (TimeoutId id, timeout_handler_proc handler) |
void | reschedule_timeouts (void) |
void | enable_timeout_after (TimeoutId id, int delay_ms) |
void | enable_timeout_every (TimeoutId id, TimestampTz fin_time, int delay_ms) |
void | enable_timeout_at (TimeoutId id, TimestampTz fin_time) |
void | enable_timeouts (const EnableTimeoutParams *timeouts, int count) |
void | disable_timeout (TimeoutId id, bool keep_indicator) |
void | disable_timeouts (const DisableTimeoutParams *timeouts, int count) |
void | disable_all_timeouts (bool keep_indicators) |
bool | get_timeout_active (TimeoutId id) |
bool | get_timeout_indicator (TimeoutId id, bool reset_indicator) |
TimestampTz | get_timeout_start_time (TimeoutId id) |
TimestampTz | get_timeout_finish_time (TimeoutId id) |
typedef enum TimeoutType TimeoutType |
enum TimeoutId |
Definition at line 23 of file timeout.h.
enum TimeoutType |
Enumerator | |
---|---|
TMPARAM_AFTER | |
TMPARAM_AT | |
TMPARAM_EVERY |
void disable_all_timeouts | ( | bool | keep_indicators | ) |
Definition at line 751 of file timeout.c.
References timeout_params::active, all_timeouts, disable_alarm, i, timeout_params::indicator, MAX_TIMEOUTS, and num_active_timeouts.
Referenced by pgarch_archiveXlog(), PostgresMain(), ResolveRecoveryConflictWithBufferPin(), and ResolveRecoveryConflictWithLock().
void disable_timeout | ( | TimeoutId | id, |
bool | keep_indicator | ||
) |
Definition at line 685 of file timeout.c.
References all_timeouts, all_timeouts_initialized, Assert, disable_alarm, find_active_timeout(), GetCurrentTimestamp(), timeout_params::indicator, num_active_timeouts, remove_timeout_index(), and schedule_alarm().
Referenced by AbortTransaction(), assign_transaction_timeout(), BackendInitialize(), CommitTransaction(), disable_startup_progress_timeout(), disable_statement_timeout(), enable_statement_timeout(), PerformAuthentication(), PostgresMain(), PrepareTransaction(), and ProcSleep().
void disable_timeouts | ( | const DisableTimeoutParams * | timeouts, |
int | count | ||
) |
Definition at line 718 of file timeout.c.
References all_timeouts, all_timeouts_initialized, Assert, disable_alarm, find_active_timeout(), GetCurrentTimestamp(), i, DisableTimeoutParams::id, timeout_params::indicator, num_active_timeouts, remove_timeout_index(), and schedule_alarm().
Referenced by LockErrorCleanup(), and ProcSleep().
void enable_timeout_after | ( | TimeoutId | id, |
int | delay_ms | ||
) |
Definition at line 560 of file timeout.c.
References disable_alarm, enable_timeout(), GetCurrentTimestamp(), now(), schedule_alarm(), and TimestampTzPlusMilliseconds.
Referenced by assign_transaction_timeout(), BackendInitialize(), enable_statement_timeout(), PerformAuthentication(), PostgresMain(), ProcessInterrupts(), ProcSleep(), start_xact_command(), and StartTransaction().
void enable_timeout_at | ( | TimeoutId | id, |
TimestampTz | fin_time | ||
) |
Definition at line 607 of file timeout.c.
References disable_alarm, enable_timeout(), GetCurrentTimestamp(), now(), and schedule_alarm().
void enable_timeout_every | ( | TimeoutId | id, |
TimestampTz | fin_time, | ||
int | delay_ms | ||
) |
Definition at line 584 of file timeout.c.
References disable_alarm, enable_timeout(), GetCurrentTimestamp(), now(), and schedule_alarm().
Referenced by enable_startup_progress_timeout().
void enable_timeouts | ( | const EnableTimeoutParams * | timeouts, |
int | count | ||
) |
Definition at line 630 of file timeout.c.
References disable_alarm, elog, enable_timeout(), ERROR, GetCurrentTimestamp(), i, EnableTimeoutParams::id, now(), schedule_alarm(), TimestampTzPlusMilliseconds, TMPARAM_AFTER, TMPARAM_AT, TMPARAM_EVERY, and type.
Referenced by ProcSleep(), ResolveRecoveryConflictWithBufferPin(), and ResolveRecoveryConflictWithLock().
bool get_timeout_active | ( | TimeoutId | id | ) |
Definition at line 780 of file timeout.c.
References timeout_params::active, and all_timeouts.
Referenced by assign_transaction_timeout(), disable_statement_timeout(), enable_statement_timeout(), PostgresMain(), and start_xact_command().
TimestampTz get_timeout_finish_time | ( | TimeoutId | id | ) |
Definition at line 827 of file timeout.c.
References all_timeouts, and timeout_params::fin_time.
Referenced by ProcessInterrupts().
bool get_timeout_indicator | ( | TimeoutId | id, |
bool | reset_indicator | ||
) |
Definition at line 793 of file timeout.c.
References all_timeouts, and timeout_params::indicator.
Referenced by ProcessInterrupts().
TimestampTz get_timeout_start_time | ( | TimeoutId | id | ) |
Definition at line 813 of file timeout.c.
References all_timeouts, and timeout_params::start_time.
Referenced by ProcSleep().
void InitializeTimeouts | ( | void | ) |
Definition at line 470 of file timeout.c.
References timeout_params::active, all_timeouts, all_timeouts_initialized, disable_alarm, timeout_params::fin_time, handle_sig_alarm(), i, timeout_params::index, timeout_params::indicator, timeout_params::interval_in_ms, MAX_TIMEOUTS, num_active_timeouts, pqsignal(), SIGALRM, timeout_params::start_time, and timeout_params::timeout_handler.
Referenced by AutoVacWorkerMain(), BackendInitialize(), BackgroundWorkerMain(), PostgresMain(), ReplSlotSyncWorkerMain(), StartupProcessMain(), and WalSndSignals().
TimeoutId RegisterTimeout | ( | TimeoutId | id, |
timeout_handler_proc | handler | ||
) |
Definition at line 505 of file timeout.c.
References all_timeouts, all_timeouts_initialized, Assert, ereport, errcode(), errmsg(), FATAL, MAX_TIMEOUTS, timeout_params::timeout_handler, and USER_TIMEOUT.
Referenced by BackendInitialize(), InitPostgres(), StartupProcessMain(), and StartupXLOG().
void reschedule_timeouts | ( | void | ) |
Definition at line 540 of file timeout.c.
References all_timeouts_initialized, disable_alarm, GetCurrentTimestamp(), num_active_timeouts, and schedule_alarm().
Referenced by AbortSubTransaction(), and AbortTransaction().