GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
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
What did you do?
hit ctrl+c with the same session to cancel, or kill id in another session.
What did you expect to see?
kill the sleep query.
What did you see instead?
with ctrl+c shows ^C^C -- query aborted but blocked until the sleep query completed.
with kill id returned ok but nothing happened, sleep query completed.
^C^C -- query aborted
What version of TiDB are you using (tidb-server -V)?
This is a known issue.
We should change the builtin function implementation:
I am willing to tackle this issue. But, it's not easy for a new contributor to understand the structure of source code. I cannot find the related code about the builtin function sleep and its implementation.
Is there anyone can give me some hints?
@ladrift The implement of Sleep() is here: https://github.com/pingcap/tidb/blob/master/expression/builtin_miscellaneous.go#L99
expression: Quit builtin function SLEEP when KILLed.
Use cancellation pattern in SLEEP function by making use of
transaction's context. But, it does not quit when Ctrl-C
pressed. Add TODO for future investigation.
Fix #4378 partially