Skip to content

conn.Close() is not called on read-timeout connections #34722

Closed
@seiya-annie

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. get_lock('test1', 200) in session 1;
  2. SELECT GET_LOCK('test1',0), GET_LOCK('test2',0); in session 2;
  3. close the network and two sessions are disconnected;
  4. reconnect the network
  5. check with select * from information_schema.data_lock_waits;
  6. get_lock('test1', 200) in session 3;
  7. get_lock('test2',200) in session 4;

2. What did you expect to see? (Required)

for step 6: expect return 1
for step 7: expect return 1

3. What did you see instead (Required)

  1. after reconnect, lock test1 and test2 can't acquire in any session

  2. test2 was never acquired successfully by any session, and can't find wait_lock in data_lock_waits table, why can't it be acquired after reconnecting?

+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+--------------------+------------------------+------------------------------------------------------------------+-----------------+
| KEY | KEY_INFO | TRX_ID | CURRENT_HOLDING_TRX_ID | SQL_DIGEST | SQL_DIGEST_TEXT |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+--------------------+------------------------+------------------------------------------------------------------+-----------------+
| 7480000000000000435F698000000000000001017465737431000000FC | {"db_id":3,"db_name":"mysql","table_id":67,"table_name":"advisory_locks","index_id":1,"index_name":"PRIMARY","index_values":["test1"]} | 433260456328298499 | 433260404148535299 | 503fd5b0bd3ca476326b20cdb82e8088bb82376f9a3b81c2f1887bcf46bb3da6 | NULL |
+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+--------------------+------------------------+------------------------------------------------------------------+-----------------+
1 row in set (0.01 sec)
mysql> select get_lock('test2',200);
+-----------------------+
| get_lock('test2',200) |
+-----------------------+
| 0 |
+-----------------------+
1 row in set (3 min 20.01 sec)

4. What is your TiDB version? (Required)

| Release Version: v6.1.0-alpha
Edition: Community
Git Commit Hash: 90e24b9
Git Branch: heads/refs/tags/v6.1.0-alpha
UTC Build Time: 2022-05-15 14:57:27
GoVersion: go1.18
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

affects-4.0This bug affects 4.0.x versions.affects-5.0This bug affects 5.0.x versions.affects-5.1This bug affects 5.1.x versions.affects-5.2This bug affects 5.2.x versions.affects-5.3This bug affects 5.3.x versions.affects-5.4This bug affects the 5.4.x(LTS) versions.affects-6.0severity/criticalsig/sql-infraSIG: SQL Infratype/bugThe issue is confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions