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

valid named pipe connection is closed, if reconnect is set

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Fixed
    • 3.3, 3.4, 3.1.27
    • 3.1.28, 3.3.15, 3.4.5
    • Other
    • None

    Description

      As it turns out, the last-moment change for CONC-589 closes an alive/valid named pipe connection, if reconnect flag is set.

       
        /* CONC-589: If reconnect option was specified, we have to check if the connection
                     (socket) is still available */
        if (command != COM_QUIT && mysql->options.reconnect && ma_pvio_is_alive(mysql->net.pvio))
        {
          ma_pvio_close(mysql->net.pvio);
          mysql->net.pvio= NULL;
          mysql->net.error= 1;
        }
      
      

      ma_pvio_is_alive is resolved as pvio_npipe_is_alive , which correctly returns TRUE indicating connetion is alive-yes (Don't know, does it return is_alive = FALSE indicating is alive on sockets?)

      Anyway as a next step, valid/alive named pipe connection is closed.

      This together with reconnect flags, leads to reconnection attempt and ultimately stack overflow in mariadb-check as seen in the attached reconnect_stacktrace.txt

      Running mysql_upgrade (which also starts other utilitites etc, so it is mariadb-check, that is crashed here). The full stacktrace is in the attachment, which calls ma_simple_command

      the repeating sequence in the stacktrace is below, mariadb_reconnect calls mysql_set_character_set which in turn calls mysql_real_query ( ("SET NAMES utf8mb4") , mthd_my_send_cmd, and mariadb_reconnect again.

      >	mariadb-check.exe!mariadb_reconnect(st_mysql * mysql=0x0000004b182c5860) Line 2185	C
       	mariadb-check.exe!mthd_my_send_cmd(st_mysql * mysql=0x0000004b182c5860, enum_server_command command=COM_QUERY, const char * arg=0x0000004b182c57a0, unsigned __int64 length=17, char skip_check='\x1', void * opt_arg=0x0000000000000000) Line 414	C
       	mariadb-check.exe!ma_simple_command(st_mysql * mysql=0x0000004b182c5860, enum_server_command command=COM_QUERY, const char * arg=0x0000004b182c57a0, unsigned __int64 length=17, char skip_check='\x1', void * opt_arg=0x0000000000000000) Line 493	C
       	mariadb-check.exe!mysql_real_query(st_mysql * mysql=0x0000004b182c5860, const char * query=0x0000004b182c57a0, unsigned long length=17) Line 3000	C
       	mariadb-check.exe!mysql_set_character_set(st_mysql * mysql=0x0000004b182c5860, const char * csname=0x00007ff7718048d0) Line 4382	C
       	mariadb-check.exe!mariadb_reconnect(st_mysql * mysql=0x0000004b182c5fc0) Line 2185	C
      
      

      Background -mariadb-check.exe is started by mariadb-upgrade, which is started by mariadb-upgrade-service, which runs it with Windows named pipes.

      Now, this change broke all cross-version upgrades on Windows, as in MDEV-36128

      Attachments

        Issue Links

          Activity

            There are no comments yet on this issue.

            People

              georg Georg Richter
              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.