-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql: implement idle_in_transaction_session_timeout #52938
sql: implement idle_in_transaction_session_timeout #52938
Conversation
1c2fc2d
to
0bb0dc7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take it back, I lost my session setting without realizing it.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @knz)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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