MCPcopy Create free account
hub / github.com/apache/cloudberry / enable_statement_timeout

Function enable_statement_timeout

src/backend/tcop/postgres.c:6412–6429  ·  view source on GitHub ↗

* Start statement timeout timer, if enabled. * * If there's already a timeout running, don't restart the timer. That * enables compromises between accuracy of timeouts and cost of starting a * timeout. */

Source from the content-addressed store, hash-verified

6410 * timeout.
6411 */
6412static void
6413enable_statement_timeout(void)
6414{
6415 /* must be within an xact */
6416 Assert(xact_started);
6417
6418 /* always disable statement timeout in QE */
6419 if (StatementTimeout > 0 && Gp_role != GP_ROLE_EXECUTE)
6420 {
6421 if (!get_timeout_active(STATEMENT_TIMEOUT))
6422 enable_timeout_after(STATEMENT_TIMEOUT, StatementTimeout);
6423 }
6424 else
6425 {
6426 if (get_timeout_active(STATEMENT_TIMEOUT))
6427 disable_timeout(STATEMENT_TIMEOUT, false);
6428 }
6429}
6430
6431/*
6432 * Disable statement timeout, if active.

Callers 1

start_xact_commandFunction · 0.85

Calls 3

get_timeout_activeFunction · 0.85
enable_timeout_afterFunction · 0.85
disable_timeoutFunction · 0.85

Tested by

no test coverage detected