Skip to content

`disable_statement_timeout` will no longer leak to other migrations

Gabriel Mazetto requested to merge 48967-disable-statement-timeout into master

What does this MR do?

Adds transaction: true/false (defaults to true) to disable_statement_timeout. This controls whether SET LOCAL will be used to define statement_timeout value to 0.

When transaction: false it requires a block, so the code inside the block will be executed with "disabled statement timeout", after it executes it cleans up connection state with RESET ALL.

Are there points in the code the reviewer needs to double check?

Please double-check if I enclosed the right pieces while fixing existing migrations.

The EE build is in here: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6444 with any extra fix required in separate commits.

Why was this MR needed?

Using disable_statement_timeout can leak to other transactions and queries inside the same connection, until connection is closed or RESET ALL is called (from pgbouncer using isolation: transaction)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #48967 (closed)

Edited by Gabriel Mazetto

Merge request reports