Details

    • 5.5.49

    Description

      Client that is connected with SSL, that stays idle for a while, will be disconnected.
      To reproduce

      • start the server with ssl, e.g

        perl mysql-test-run.pl ssl --start

      • connect with ssl client, e.g

        mysql -uroot --port=16000 --ssl

      • issue a command, e.g SELECT 1
      • wait 1 minute
      • repeat SELECT 1
      • see

        ERROR 2013 (HY000): Lost connection to MySQL server during query

      Attachments

        Activity

          wlad Vladislav Vaintroub created issue -
          wlad Vladislav Vaintroub made changes -
          Field Original Value New Value
          Description Client that is connected with SSL, that stays idle for a while, will be disconnected.
          To reproduce

          * start the server with ssl, e.g
          {{ perl mysql-test-run.pl ssl --start }}
          * connect with ssl client, e.g
          {{mysql -uroot --port=16000 --ssl}}
          * issue a command, e.g SELECT 1
          * wait 1 minute
          * repeat SELECT 1

          {{
          ERROR 2013 (HY000): Lost connection to MySQL server during query
          }}



          Client that is connected with SSL, that stays idle for a while, will be disconnected.
          To reproduce

          * start the server with ssl, e.g
          {{ perl mysql-test-run.pl ssl --start }}
          * connect with ssl client, e.g
          {{ mysql -uroot --port=16000 --ssl }}
          * issue a command, e.g SELECT 1
          * wait 1 minute
          * repeat SELECT 1

          {{ ERROR 2013 (HY000): Lost connection to MySQL server during query }}



          wlad Vladislav Vaintroub made changes -
          Description Client that is connected with SSL, that stays idle for a while, will be disconnected.
          To reproduce

          * start the server with ssl, e.g
          {{ perl mysql-test-run.pl ssl --start }}
          * connect with ssl client, e.g
          {{ mysql -uroot --port=16000 --ssl }}
          * issue a command, e.g SELECT 1
          * wait 1 minute
          * repeat SELECT 1

          {{ ERROR 2013 (HY000): Lost connection to MySQL server during query }}



          Client that is connected with SSL, that stays idle for a while, will be disconnected.
          To reproduce

          * start the server with ssl, e.g
          perl mysql-test-run.pl ssl --start

          * connect with ssl client, e.g
           mysql -uroot --port=16000 --ssl
          * issue a command, e.g SELECT 1
          * wait 1 minute
          * repeat SELECT 1

          *see ERROR 2013 (HY000): Lost connection to MySQL server during query



          wlad Vladislav Vaintroub added a comment - - edited

          The actual reason why the connection is lost seems to be a bug in yassl's implementation of SSL_pending(), which is called inside vio_ssl_has_data().
          The socket is doing blocking recv() inside this function, and runs into net_read_timeout after a while. After that, connection breaks.

          Doing blocking reads inside vio_ssl_has_data (or SSL_pending) does not sound like a great idea.

          Below is the callstack of the blocking recv() calls

          >Debug.ListCallStack /T:No /ShowByteOffset:No /ShowValues:No /ShowExternalCode:Yes
           Index  Function
          --------------------------------------------------------------------------------
           1      ntdll.dll!_ZwWaitForSingleObject@12()
           2      mswsock.dll!_SockWaitForSingleObject@16()
           3      mswsock.dll!_WSPRecv@36()
           4      ws2_32.dll!_recv@16()
          *5      mysqld.exe!yaSSL::Socket::wait()
           6      mysqld.exe!yaSSL::DoProcessReply(ssl)
           7      mysqld.exe!yaSSL::processReply(ssl)
           8      mysqld.exe!yaSSL::receiveData(ssl, data, peek)
           9      mysqld.exe!yaSSL_peek(ssl, buffer, sz)
           10     mysqld.exe!yaSSL_pending(ssl)
           11     mysqld.exe!vio_ssl_has_data(vio)
           12     mysqld.exe!threadpool_process_request(thd)
           13     mysqld.exe!io_completion_callback(instance, context, overlapped, io_result, nbytes, io)
           
           ---------------------------------------------------------------------------------
           1      mysqld.exe!vio_read(vio, buf, size)
           2      mysqld.exe!yassl_recv(ptr, buf, len, flag)
           3      mysqld.exe!yaSSL::Socket::receive(buf, sz, flags)
           4      mysqld.exe!yaSSL::DoProcessReply(ssl)
           5      mysqld.exe!yaSSL::processReply(ssl)
           6      mysqld.exe!yaSSL::receiveData(ssl, data, peek)
           7      mysqld.exe!yaSSL_peek(ssl, buffer, sz)
           8      mysqld.exe!yaSSL_pending(ssl)
           9      mysqld.exe!vio_ssl_has_data(vio)
           10     mysqld.exe!threadpool_process_request(thd)
           11     mysqld.exe!io_completion_callback(instance, context, overlapped, io_result, nbytes, io)
          

          wlad Vladislav Vaintroub added a comment - - edited The actual reason why the connection is lost seems to be a bug in yassl's implementation of SSL_pending() , which is called inside vio_ssl_has_data() . The socket is doing blocking recv() inside this function, and runs into net_read_timeout after a while. After that, connection breaks. Doing blocking reads inside vio_ssl_has_data (or SSL_pending ) does not sound like a great idea. Below is the callstack of the blocking recv() calls >Debug.ListCallStack /T:No /ShowByteOffset:No /ShowValues:No /ShowExternalCode:Yes Index Function -------------------------------------------------------------------------------- 1 ntdll.dll!_ZwWaitForSingleObject@12() 2 mswsock.dll!_SockWaitForSingleObject@16() 3 mswsock.dll!_WSPRecv@36() 4 ws2_32.dll!_recv@16() *5 mysqld.exe!yaSSL::Socket::wait() 6 mysqld.exe!yaSSL::DoProcessReply(ssl) 7 mysqld.exe!yaSSL::processReply(ssl) 8 mysqld.exe!yaSSL::receiveData(ssl, data, peek) 9 mysqld.exe!yaSSL_peek(ssl, buffer, sz) 10 mysqld.exe!yaSSL_pending(ssl) 11 mysqld.exe!vio_ssl_has_data(vio) 12 mysqld.exe!threadpool_process_request(thd) 13 mysqld.exe!io_completion_callback(instance, context, overlapped, io_result, nbytes, io) --------------------------------------------------------------------------------- 1 mysqld.exe!vio_read(vio, buf, size) 2 mysqld.exe!yassl_recv(ptr, buf, len, flag) 3 mysqld.exe!yaSSL::Socket::receive(buf, sz, flags) 4 mysqld.exe!yaSSL::DoProcessReply(ssl) 5 mysqld.exe!yaSSL::processReply(ssl) 6 mysqld.exe!yaSSL::receiveData(ssl, data, peek) 7 mysqld.exe!yaSSL_peek(ssl, buffer, sz) 8 mysqld.exe!yaSSL_pending(ssl) 9 mysqld.exe!vio_ssl_has_data(vio) 10 mysqld.exe!threadpool_process_request(thd) 11 mysqld.exe!io_completion_callback(instance, context, overlapped, io_result, nbytes, io)
          serg Sergei Golubchik made changes -
          Description Client that is connected with SSL, that stays idle for a while, will be disconnected.
          To reproduce

          * start the server with ssl, e.g
          perl mysql-test-run.pl ssl --start

          * connect with ssl client, e.g
           mysql -uroot --port=16000 --ssl
          * issue a command, e.g SELECT 1
          * wait 1 minute
          * repeat SELECT 1

          *see ERROR 2013 (HY000): Lost connection to MySQL server during query



          Client that is connected with SSL, that stays idle for a while, will be disconnected.
          To reproduce

          * start the server with ssl, e.g
          {code}perl mysql-test-run.pl ssl --start{code}

          * connect with ssl client, e.g
          {code}mysql -uroot --port=16000 --ssl{code}
          * issue a command, e.g {{SELECT 1}}
          * wait 1 minute
          * repeat {{SELECT 1}}

          * see
          {noformat}ERROR 2013 (HY000): Lost connection to MySQL server during query{noformat}



          elenst Elena Stepanova made changes -
          Status Open [ 1 ] Confirmed [ 10101 ]
          elenst Elena Stepanova made changes -
          Affects Version/s 5.5 [ 15800 ]
          Affects Version/s 10.0 [ 16000 ]
          Affects Version/s 10.1 [ 16100 ]
          elenst Elena Stepanova made changes -
          Fix Version/s 5.5 [ 15800 ]
          Fix Version/s 10.0 [ 16000 ]
          Fix Version/s 10.1 [ 16100 ]
          elenst Elena Stepanova made changes -
          Assignee Vladislav Vaintroub [ wlad ]
          serg Sergei Golubchik made changes -
          Assignee Vladislav Vaintroub [ wlad ] Sergei Golubchik [ serg ]
          serg Sergei Golubchik made changes -
          Status Confirmed [ 10101 ] In Review [ 10002 ]
          ratzpo Rasmus Johansson (Inactive) made changes -
          Sprint 5.5.49-1 [ 48 ]
          serg Sergei Golubchik made changes -
          Assignee Sergei Golubchik [ serg ] Vladislav Vaintroub [ wlad ]
          Status In Review [ 10002 ] Stalled [ 10000 ]
          serg Sergei Golubchik made changes -
          Assignee Vladislav Vaintroub [ wlad ] Sergei Golubchik [ serg ]
          serg Sergei Golubchik made changes -
          Fix Version/s 5.5.49 [ 21600 ]
          Fix Version/s 10.0.25 [ 21701 ]
          Fix Version/s 10.1.14 [ 21804 ]
          Fix Version/s 5.5 [ 15800 ]
          Fix Version/s 10.0 [ 16000 ]
          Fix Version/s 10.1 [ 16100 ]
          Resolution Fixed [ 1 ]
          Status Stalled [ 10000 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 74710 ] MariaDB v4 [ 150279 ]

          People

            serg Sergei Golubchik
            wlad Vladislav Vaintroub
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.