sql: implement idle_in_transaction_session_timeout#52938
Conversation
1c2fc2d to
0bb0dc7
Compare
solongordon
left a comment
There was a problem hiding this comment.
I just tested this out manually and something seems off. I set the timeout variable and then ran BEGIN; followed immediately by SELECT 1. Then no matter how long I wait it doesn't seem like the session is canceled. Could you take a look?
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @knz and @solongordon)
solongordon
left a comment
There was a problem hiding this comment.
I take it back, I lost my session setting without realizing it.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @knz)
solongordon
left a comment
There was a problem hiding this comment.
My only real complaint is the same as last time, which is that the tests take ~30 seconds to run. Any chance you could slim that down a bit without introducing flakiness?
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @knz and @RichardJCai)
pkg/sql/conn_executor_exec.go, line 153 at r1 (raw file):
case stateOpen: // Only start timeout if the statement is executed in an // implicit transaction.
s/implicit/explicit/
pkg/sql/run_control_test.go, line 514 at r1 (raw file):
time.Sleep(3 * time.Second) // The connection should still be alive. err = conn.PingContext(ctx)
Isn't this the same as what you test at the beginning of TestIdleInTransactionSessionTimeout?
RichardJCai
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @knz, @RichardJCai, and @solongordon)
pkg/sql/run_control_test.go, line 514 at r1 (raw file):
Previously, solongordon (Solon) wrote…
Isn't this the same as what you test at the beginning of
TestIdleInTransactionSessionTimeout?
Yeah I think this is unnecessary
Release note (sql change): Implement IdleInTransactionSessionTimeout variable to allow terminating sessions that are idle in a transaction past the provides threshold. Set the variable by using SET idle_in_transaction_session_timeout = 'time'. Sessions that are idle in OPEN, ABORTED and DONE(COMMITWAIT) transaction states will be terminated if the user idles longer than the threshold time.
0bb0dc7 to
f5a1429
Compare
|
bors r+ |
|
Build succeeded: |
Release note (sql change): Implement IdleInTransactionSessionTimeout
variable to allow terminating sessions that are idle in a transaction
past the provides threshold.
Set the variable by using SET idle_in_transaction_session_timeout = 'time'.
Sessions that are idle in OPEN, ABORTED and DONE(COMMITWAIT) transaction states
will be terminated if the user idles longer than the threshold time.
Fixes #5924