Skip to content
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

wait_timeout used instead of interactive_timeout #8487

Closed
morgo opened this issue Nov 28, 2018 · 3 comments
Closed

wait_timeout used instead of interactive_timeout #8487

morgo opened this issue Nov 28, 2018 · 3 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility

Comments

@morgo
Copy link
Contributor

morgo commented Nov 28, 2018

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?

Currently wait_timeout is also applicable for interactive sessions (i.e. mysql cli tool). The MySQL compatible behavior is as follows:

  1. What did you expect to see?
session1> set global wait_timeout = 5;
session1> set global interactive_timeout = 100;
..
session1> show global variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  | 5     |
+---------------+-------+
1 row in set (0.00 sec)

session1> show global variables like 'interactive_timeout';
+---------------------+-------+
| Variable_name       | Value |
+---------------------+-------+
| interactive_timeout | 100   |
+---------------------+-------+
1 row in set (0.01 sec)

Then control +c and start a new session:

session2> show variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  | 100   |
+---------------+-------+
1 row in set (0.00 sec)

session2> show variables like 'interactive_timeout';
+---------------------+-------+
| Variable_name       | Value |
+---------------------+-------+
| interactive_timeout | 100   |
+---------------------+-------+
1 row in set (0.01 sec)

Because the session sets the interactive bit, the interactive_timeout is actually copied over the wait_timeout. The global wait_timeout is still 5:

session2> show global variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  | 5     |
+---------------+-------+
1 row in set (0.00 sec)
  1. What did you see instead?

  2. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?

@morgo
Copy link
Contributor Author

morgo commented Nov 28, 2018

@hhxcc If you are up for it, here is how interactive_timeout behaves :-)

@lysu lysu added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Nov 28, 2018
@lysu
Copy link
Contributor

lysu commented Nov 28, 2018

@hhxcc we can check CLIENT_INTERACTIVE in ClientCapability to choosen current session timeout
init value https://dev.mysql.com/doc/internals/en/capability-flags.html#packet-Protocol::CapabilityFlags 😆

@hhu-cc
Copy link
Contributor

hhu-cc commented Nov 29, 2018

@morgo @lysu thank you , I would like to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility
Projects
None yet
Development

No branches or pull requests

3 participants