From: Christopher Powers Date: August 18 2011 5:30am Subject: bzr push into mysql-trunk branch (chris.powers:3376 to 3377) WL#4896 List-Archive: http://lists.mysql.com/commits/140691 Message-Id: <201108180530.p7I5UEFY007098@acsmt356.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3377 Christopher Powers 2011-08-18 WL#4896 "Performance Schema Net IO" Two bugs caused orphaned socket instances: 1. If there is no thread instrumentation, then get_thread_socket_locker() returns a null locker, preventing the PFS socket from being destroyed following closesocket(). 2. SSL authentication calls vio_reset() for the active connection, which reset the PSI pointer for the corresponding socket. This prevents a locker from being created on a subsequent call to closesocket(), and the PFS socket is never deleted. modified: storage/perfschema/pfs.cc vio/vio.c 3376 Christopher Powers 2011-08-17 WL#4896 "Performance Schema Net IO" - Compiler warning in pfs.cc modified: storage/perfschema/pfs.cc === modified file 'storage/perfschema/pfs.cc' --- a/storage/perfschema/pfs.cc 2011-08-17 22:46:42 +0000 +++ b/storage/perfschema/pfs.cc 2011-08-18 05:29:13 +0000 @@ -2841,13 +2841,14 @@ get_thread_socket_locker_v1(PSI_socket_l return NULL; register uint flags; + PFS_thread *pfs_thread= pfs_socket->m_thread_owner; - if (flag_thread_instrumentation) + if (flag_thread_instrumentation && likely(pfs_thread != NULL)) { - PFS_thread *pfs_thread= pfs_socket->m_thread_owner; + // PFS_thread *pfs_thread= pfs_socket->m_thread_owner; - if (unlikely(pfs_thread == NULL)) - return NULL; + //if (unlikely(pfs_thread == NULL)) + // return NULL; /* If instrumentation for this thread has been disabled, then return a null === modified file 'vio/vio.c' --- a/vio/vio.c 2011-07-08 21:31:33 +0000 +++ b/vio/vio.c 2011-08-18 05:29:13 +0000 @@ -184,6 +184,9 @@ my_bool vio_reset(Vio* vio, enum enum_vi vio_init(vio, type, sd, flags); + /* Preserve perfschema info for this connection */ + vio->mysql_socket.m_psi= old_vio.mysql_socket.m_psi; + #ifdef HAVE_OPENSSL vio->ssl_arg= ssl; #endif No bundle (reason: useless for push emails).