[MXS-4004] Race condition in KILL command execution Created: 2022-02-16  Updated: 2022-02-24  Resolved: 2022-02-23

Status: Closed
Project: MariaDB MaxScale
Component/s: Core
Affects Version/s: 2.5.19, 6.2.2
Fix Version/s: 2.5.20, 6.2.3

Type: Bug Priority: Major
Reporter: markus makela Assignee: markus makela
Resolution: Fixed Votes: 1
Labels: None


 Description   

To reproduce, run the following SQL with the mariadb client with --delimiter=// option:

BEGIN NOT ATOMIC SET @a = NOW(); WHILE TIME_TO_SEC(TIMEDIFF(NOW(), @a)) < 30 DO DO 1; END WHILE; END //

Once the query has started, interrupt it with Ctrl+C. With a direct connection to the database the connection is killed immediately but with MaxScale the KILL command it generates doesn't end up being processed correctly.

There's possibly a race condition of sorts where the execution of the sub-KILL commands that are derived from the original one end up being discarded due to the fact that the session is stopping. If this is true then the solution is to wait until all the sent commands have been written to the network before the OK packet is sent for the original KILL command.


Generated at Thu Feb 08 04:25:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.