Bug #105104 | MySQL dosen't response to connection abortion while executing query in javacliet | ||
---|---|---|---|
Submitted: | 2 Oct 2021 2:51 | Modified: | 4 Oct 2021 10:41 |
Reporter: | Brian Yue (OCA) | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 8.0.25 | OS: | Any (rhel-7.4) |
Assigned to: | MySQL Verification Team | CPU Architecture: | Any (x86-64) |
Tags: | abort connection, java, no response |
[2 Oct 2021 2:51]
Brian Yue
[2 Oct 2021 7:45]
MySQL Verification Team
seen https://bugs.mysql.com/bug.php?id=78809 ?
[3 Oct 2021 2:01]
Brian Yue
Hello, The problem I'm encountering is similar with `https://bugs.mysql.com/bug.php?id=78809`, but there is a difference. If the query is running with java client, the query will keep running forever util finished; But if the query is running (prepare & execute) through mysql client in linux shell, the query will stop in several seconds. So I don't think this problem is related with long query only, maybe some other reason is also related (implementation difference ?). # 1. running the query with prepared statement in mysql shell client mysql> prepare ps from 'select * from yxx.t1' ; Query OK, 0 rows affected (0.00 sec) Statement prepared mysql> execute ps; # 2. we can find the process mysql> show processlist; +----+-----------------+-------------------+------+---------+-------+------------------------+----------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+-----------------+-------------------+------+---------+-------+------------------------+----------------------+ | 6 | event_scheduler | localhost | NULL | Daemon | 86058 | Waiting on empty queue | NULL | | 26 | root | 10.229.31.7:20085 | NULL | Query | 2 | executing | select * from yxx.t1 | | 27 | root | localhost | NULL | Query | 0 | init | show processlist | +----+-----------------+-------------------+------+---------+-------+------------------------+----------------------+ 3 rows in set (0.00 sec) # 3. make the mysql cient die [root@localhost ~]# ps -ef | grep mysql yxx_sys+ 27076 25440 0 09:38 pts/2 00:00:00 mysql -uroot -px xxxxxx -h10.229.31.41 -P6310 root 28627 43682 0 09:40 pts/5 00:00:00 grep --color=auto mysql [root@localhost ~]# kill -9 27076 [root@localhost ~]# ps -ef | grep mysql root 29008 43682 0 09:41 pts/5 00:00:00 grep --color=auto mysql mysql> execute ps; Killed # 4. After several seconds, the process vanished mysql> show processlist; +----+-----------------+-------------------+------+---------+-------+------------------------+----------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+-----------------+-------------------+------+---------+-------+------------------------+----------------------+ | 6 | event_scheduler | localhost | NULL | Daemon | 86099 | Waiting on empty queue | NULL | | 26 | root | 10.229.31.7:20085 | NULL | Query | 43 | executing | select * from yxx.t1 | | 27 | root | localhost | NULL | Query | 0 | init | show processlist | +----+-----------------+-------------------+------+---------+-------+------------------------+----------------------+ 3 rows in set (0.00 sec) mysql> show processlist; +----+-----------------+-------------------+------+---------+-------+------------------------+----------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+-----------------+-------------------+------+---------+-------+------------------------+----------------------+ | 6 | event_scheduler | localhost | NULL | Daemon | 86101 | Waiting on empty queue | NULL | | 26 | root | 10.229.31.7:20085 | NULL | Query | 45 | executing | select * from yxx.t1 | | 27 | root | localhost | NULL | Query | 0 | init | show processlist | +----+-----------------+-------------------+------+---------+-------+------------------------+----------------------+ 3 rows in set (0.00 sec) mysql> show processlist; +----+-----------------+-------------------+------+---------+-------+------------------------+----------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+-----------------+-------------------+------+---------+-------+------------------------+----------------------+ | 6 | event_scheduler | localhost | NULL | Daemon | 86103 | Waiting on empty queue | NULL | | 26 | root | 10.229.31.7:20085 | NULL | Query | 47 | executing | select * from yxx.t1 | | 27 | root | localhost | NULL | Query | 0 | init | show processlist | +----+-----------------+-------------------+------+---------+-------+------------------------+----------------------+ 3 rows in set (0.00 sec) mysql> show processlist; +----+-----------------+-----------+------+---------+-------+------------------------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+-----------------+-----------+------+---------+-------+------------------------+------------------+ | 6 | event_scheduler | localhost | NULL | Daemon | 86105 | Waiting on empty queue | NULL | | 27 | root | localhost | NULL | Query | 0 | init | show processlist | +----+-----------------+-----------+------+---------+-------+------------------------+------------------+ 2 rows in set (0.00 sec) mysql> show processlist; +----+-----------------+-----------+------+---------+-------+------------------------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+-----------------+-----------+------+---------+-------+------------------------+------------------+ | 6 | event_scheduler | localhost | NULL | Daemon | 86627 | Waiting on empty queue | NULL | | 27 | root | localhost | NULL | Query | 0 | init | show processlist | +----+-----------------+-----------+------+---------+-------+------------------------+------------------+ 2 rows in set (0.00 sec)
[4 Oct 2021 10:41]
MySQL Verification Team
Hi Brian, This is a duplicate of bug #78809 and if you see in the bug #78809 it is specifically mentioned that inconsistencies in how different queries behave (for some the query will stop if connection is lost and for others it will not) is part of the bug. Thanks for your interest!