Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-6182

CTRL+C with Connect engine doesn't work

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.0.10, 10.0.14
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Hi,

      CTRL+C doesn't work properly with CONNECT :

      MariaDB [test]> SELECT * FROM url_list_connect LIMIT 10;
      ^CCtrl-C -- query killed. Continuing normally.
      ^CCtrl-C -- query killed. Continuing normally.
      ERROR 2013 (HY000): Lost connection to MySQL server during query
      MariaDB [test]> show processlist;
      ERROR 2006 (HY000): MySQL server has gone away
      No connection. Trying to reconnect...
      Connection id:    350
      Current database: test
      
      +-----+------+-----------------+--------+---------+------+-----------------------------+------------------------------------------------------------------------------------------------------+----------+
      | Id  | User | Host            | db     | Command | Time | State                       | Info                                                                                                 | Progress |
      +-----+------+-----------------+--------+---------+------+-----------------------------+------------------------------------------------------------------------------------------------------+----------+
      | 309 | jira | 127.0.0.1:58647 | jiradb | Sleep   |   39 |                             | NULL                                                                                                 |    0.000 |
      | 346 | root | localhost       | test   | Killed  |   13 | Sending data                | SELECT * FROM url_list_connect LIMIT 10                                                              |    0.000 |
      | 347 | root | localhost       | test   | Query   |   13 | Queried about 14730000 rows | SELECT `id`, `url`, `date`, `id_license_domain`, `id_license`, `dom`, `loadtime`, `gen`, `script`, ` |    0.000 |
      | 350 | root | localhost       | test   | Query   |    0 | init                        | show processlist                                                                                     |    0.000 |
      +-----+------+-----------------+--------+---------+------+-----------------------------+------------------------------------------------------------------------------------------------------+----------+
      4 rows in set (0.00 sec)
      
      MariaDB [test]> kill 347;
      Query OK, 0 rows affected (0.00 sec)
      
      MariaDB [test]> show processlist;
      +-----+------+-----------------+--------+---------+------+-------+------------------+----------+
      | Id  | User | Host            | db     | Command | Time | State | Info             | Progress |
      +-----+------+-----------------+--------+---------+------+-------+------------------+----------+
      | 309 | jira | 127.0.0.1:58647 | jiradb | Sleep   |   55 |       | NULL             |    0.000 |
      | 350 | root | localhost       | test   | Query   |    0 | init  | show processlist |    0.000 |
      +-----+------+-----------------+--------+---------+------+-------+------------------+----------+
      2 rows in set (0.00 sec)
      

      Thanks and regards,
      Jocelyn Fournier

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -

            Hi Jocelyn,

            Are you still experiencing the problem with Ctrl+C? Should we keep the bug open?

            Show
            elenst Elena Stepanova added a comment - Hi Jocelyn, Are you still experiencing the problem with Ctrl+C? Should we keep the bug open?
            Hide
            jocel1 jocelyn fournier added a comment -

            Hi Elena,

            I've just made the test with 10.0.13, and the issue is still there.

            Jocelyn

            Show
            jocel1 jocelyn fournier added a comment - Hi Elena, I've just made the test with 10.0.13, and the issue is still there. Jocelyn
            Hide
            bertrandop Olivier Bertrand added a comment -

            This seems to be fairly complex. Testing with the FEDERATED engine, I got these results:

            MariaDB [test]> select * from fediag limit 10;
            Ctrl-C -- query killed. Continuing normally.
            ERROR 1317 (70100): Query execution was interrupted
            

            It seems OK, however after canceling, the remote query seemed to continue and the second message came only after 2 minutes, the same time the query was taking when not interrupted.

            Pressing twice Ctrl-C had the following effect:

            MariaDB [test]> select * from fediag limit 10;
            Ctrl-C -- query killed. Continuing normally.
            ^C
            D:\MariaDB 10.0\bin>mysql
            

            The second one interrupted the whole session.

            Show
            bertrandop Olivier Bertrand added a comment - This seems to be fairly complex. Testing with the FEDERATED engine, I got these results: MariaDB [test]> select * from fediag limit 10; Ctrl-C -- query killed. Continuing normally. ERROR 1317 (70100): Query execution was interrupted It seems OK, however after canceling, the remote query seemed to continue and the second message came only after 2 minutes, the same time the query was taking when not interrupted. Pressing twice Ctrl-C had the following effect: MariaDB [test]> select * from fediag limit 10; Ctrl-C -- query killed. Continuing normally. ^C D:\MariaDB 10.0\bin>mysql The second one interrupted the whole session.
            Hide
            bertrandop Olivier Bertrand added a comment -

            Now I have done the same tests with a CONNEC table of MYSQL type:

            MariaDB [test]> select * from remdiag limit 10;
            Ctrl-C -- query killed. Continuing normally.
            ERROR 1317 (70100): Query execution was interrupted
            

            Same waiting for two minutes before the "Query execution was interrupted" was printed.

            And with two Ctrl-C:

            MariaDB [test]> select * from remdiag limit 10;
            Ctrl-C -- query killed. Continuing normally.
            ^C
            D:\MariaDB 10.0\bin>
            

            See? Exactly the same behaviour. Therefore this is not a CONNECT issue but an issue about how to interrupt remote queries.

            Show
            bertrandop Olivier Bertrand added a comment - Now I have done the same tests with a CONNEC table of MYSQL type: MariaDB [test]> select * from remdiag limit 10; Ctrl-C -- query killed. Continuing normally. ERROR 1317 (70100): Query execution was interrupted Same waiting for two minutes before the "Query execution was interrupted" was printed. And with two Ctrl-C: MariaDB [test]> select * from remdiag limit 10; Ctrl-C -- query killed. Continuing normally. ^C D:\MariaDB 10.0\bin> See? Exactly the same behaviour. Therefore this is not a CONNECT issue but an issue about how to interrupt remote queries.
            Hide
            elenst Elena Stepanova added a comment - - edited

            So, the problem here is that upon Ctrl+C, the "local" query gets killed, but the "remote" query keeps running.
            I can reproduce it quite easily with both Connect and Federated as the local table, TokuDB and InnoDB as the remote table with a manual test – 1,000,000 rows in the underlying table give me enough time to send Ctrl+C, after that I can see the "local" query in the Killed state and the "remote" query in the working state for about the same time as it normally takes to execute the whole thing.

            In MySQL, the whole Ctrl+C thing seems to work a bit differently, but the result is basically the same – not everything gets interrupted.

            I'll leave it to Sergei Golubchik to decide whether it's a bug and needs to be fixed. After all, Ctrl+C apparently just sends KILL QUERY to the connection where it's triggered; and the "remote" query is running in a separate connection, so why would it be interrupted?.. Expectedly, the same happens if I run KILL QUERY <local connection> from another thread.
            I suppose the semantics of Ctrl+C or KILL QUERY can be changed so that it also kills queries in "child" connections, but I don't know whether it's desirable.

            Show
            elenst Elena Stepanova added a comment - - edited So, the problem here is that upon Ctrl+C, the "local" query gets killed, but the "remote" query keeps running. I can reproduce it quite easily with both Connect and Federated as the local table, TokuDB and InnoDB as the remote table with a manual test – 1,000,000 rows in the underlying table give me enough time to send Ctrl+C, after that I can see the "local" query in the Killed state and the "remote" query in the working state for about the same time as it normally takes to execute the whole thing. In MySQL, the whole Ctrl+C thing seems to work a bit differently, but the result is basically the same – not everything gets interrupted. I'll leave it to Sergei Golubchik to decide whether it's a bug and needs to be fixed. After all, Ctrl+C apparently just sends KILL QUERY to the connection where it's triggered; and the "remote" query is running in a separate connection, so why would it be interrupted?.. Expectedly, the same happens if I run KILL QUERY <local connection> from another thread. I suppose the semantics of Ctrl+C or KILL QUERY can be changed so that it also kills queries in "child" connections, but I don't know whether it's desirable.

              People

              • Assignee:
                serg Sergei Golubchik
                Reporter:
                jocel1 jocelyn fournier
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: