Uploaded image for project: 'MariaDB Connector/C'
  1. MariaDB Connector/C
  2. CONC-184

Provide a way to cancel/interrupt current call via new mysql_cancel() function

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.1
    • Labels:
      None

      Description

      the effect should be similar to mysql_query("KILL <id>"), however this is for environment where creating a second connection to issue kill is not feasible.

      mysql_close cannot be used because it deallocates the memory, which we do not want ( we do not want even to close the socket because it may have some interesting race conditions)

      Specifically, this call is required inside the server to interrupt slave thread that is stuck in long read call. Currently, server uses mysql->net.vio of the slave connection to issue a vio_shutdown() which comes down to either socket shutdown() call, or to CancelIoEx(), or to setting some event for shared memory. This will make further calls than require IO fail, without deallocating or invalidating the rest of MYSQL struct.

      There is no NET and no VIO in Connector/C, we do not want to expose there structures, the high-level new call should be mysql_cancel(MYSQL *mysql) , or mysql_abort(MYSQL *mysql) that does the job of killing the connection pointed to my `mysql` parameter slightly less gracefully than a KILL would do (but more reliable and much cheaper and faster)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                wlad Vladislav Vaintroub
                Reporter:
                wlad Vladislav Vaintroub
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: