* 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. */
| 6410 | * timeout. |
| 6411 | */ |
| 6412 | static void |
| 6413 | enable_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. |
no test coverage detected