From: Christopher Powers Date: July 20 2011 6:45pm Subject: bzr push into mysql-trunk branch (chris.powers:3323 to 3324) WL#4896 List-Archive: http://lists.mysql.com/commits/140393 Message-Id: <201107201845.p6KIjjQ2019918@acsmt358.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3324 Christopher Powers 2011-07-20 WL#4896 "Performance Schema Net IO" - Handle socket accept() more effectively for listener sockets modified: sql/mysqld.cc storage/perfschema/pfs.cc 3323 Christopher Powers 2011-07-19 WL#4896 "Performance Schema Net IO" Fix for socket accept() modified: include/mysql/psi/mysql_socket.h === modified file 'sql/mysqld.cc' --- a/sql/mysqld.cc 2011-07-19 07:17:11 +0000 +++ b/sql/mysqld.cc 2011-07-20 18:44:46 +0000 @@ -5502,6 +5502,7 @@ void handle_connections_sockets() #ifdef HAVE_POLL int socket_count= 0; struct pollfd fds[2]; // for ip_sock and unix_sock + MYSQL_SOCKET pfs_fds[2]; // for performance schema #else fd_set readFDs,clientFDs; uint max_used_connection= (uint)(max(mysql_socket_getfd(ip_sock), mysql_socket_getfd(unix_sock))+1); @@ -5522,6 +5523,7 @@ void handle_connections_sockets() #ifdef HAVE_POLL fds[socket_count].fd= mysql_socket_getfd(ip_sock); fds[socket_count].events= POLLIN; + pfs_fds[socket_count]= ip_sock; socket_count++; #else FD_SET(mysql_socket_getfd(ip_sock), &clientFDs); @@ -5535,6 +5537,7 @@ void handle_connections_sockets() #ifdef HAVE_POLL fds[socket_count].fd= mysql_socket_getfd(unix_sock); fds[socket_count].events= POLLIN; + pfs_fds[socket_count]= unix_sock; socket_count++; #else FD_SET(mysql_socket_getfd(unix_sock), &clientFDs); @@ -5579,7 +5582,7 @@ void handle_connections_sockets() { if (fds[i].revents & POLLIN) { - mysql_socket_setfd(&sock, fds[i].fd); + sock= pfs_fds[i]; #ifdef HAVE_FCNTL flags= fcntl(mysql_socket_getfd(sock), F_GETFL, 0); #else === modified file 'storage/perfschema/pfs.cc' --- a/storage/perfschema/pfs.cc 2011-07-17 03:30:21 +0000 +++ b/storage/perfschema/pfs.cc 2011-07-20 18:44:46 +0000 @@ -2761,8 +2761,10 @@ get_thread_socket_locker_v1(PSI_socket_l DBUG_ASSERT(static_cast (op) < array_elements(socket_operation_map)); DBUG_ASSERT(state != NULL); PFS_socket *pfs_socket= reinterpret_cast (socket); + if (unlikely(pfs_socket == NULL)) return NULL; + DBUG_ASSERT(pfs_socket->m_class != NULL); if (pfs_socket->m_idle || !pfs_socket->m_enabled) No bundle (reason: useless for push emails).