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

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 3.0.1
    • None
    • 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

            wlad Vladislav Vaintroub created issue -
            wlad Vladislav Vaintroub made changes -
            Field Original Value New Value
            wlad Vladislav Vaintroub made changes -
            Assignee Georg Richter [ georg ] Vladislav Vaintroub [ wlad ]

            The mentioned server functionality (using vio of slaves MYSQL struct) is inside
            sql/slave.cc (set_active_vio)
            sql/class.cc (vio_shutdown)

            wlad Vladislav Vaintroub added a comment - The mentioned server functionality (using vio of slaves MYSQL struct) is inside sql/slave.cc (set_active_vio) sql/class.cc (vio_shutdown)
            wlad Vladislav Vaintroub made changes -
            Fix Version/s 3.0.0 [ 18700 ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            georg Georg Richter made changes -
            Fix Version/s 3.0.1 [ 21501 ]
            Fix Version/s 3.0.0 [ 18700 ]
            julien.fritsch Julien Fritsch made changes -
            Workflow MariaDB connectors [ 75724 ] MariaDB v4 [ 161023 ]

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.