Bug #38968 Unused mutex LOCK_bytes_sent, LOCK_bytes_received
Submitted: 22 Aug 2008 17:28 Modified: 12 Nov 2009 18:57
Reporter: Marc ALFF Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S5 (Performance)
Version:5.1-bzr, 5.0-bzr, 6.0-bzr OS:Any
Assigned to: Marc ALFF CPU Architecture:Any

[22 Aug 2008 17:28] Marc ALFF
Description:
The following mutexes:

pthread_mutex_t LOCK_bytes_sent, LOCK_bytes_received;

are initialized and destroyed, but never locked / unlocked in the server code.

How to repeat:
Code review

Suggested fix:
Remove
[22 Aug 2008 17:37] Valeriy Kravchuk
Thank you for a problem report. Verified with 6.0-bzr:

openxs@suse:/home2/openxs/bzr/mysql-6.0> grep -r -n LOCK_bytes_sent *
sql/net_serv.cc:93:extern pthread_mutex_t LOCK_bytes_sent , LOCK_bytes_received;
sql/mysql_priv.h:2076:       LOCK_bytes_sent, LOCK_bytes_received, LOCK_connection_count;
sql/mysqld.cc:683:              LOCK_crypt, LOCK_bytes_sent, LOCK_bytes_received,
sql/mysqld.cc:1460:  (void) pthread_mutex_destroy(&LOCK_bytes_sent);
sql/mysqld.cc:3666:  (void) pthread_mutex_init(&LOCK_bytes_sent,MY_MUTEX_INIT_FAST);

with 5.1-bzr:

openxs@suse:/home2/openxs/bzr/mysql-5.1> grep -r -n LOCK_bytes_sent *
sql/mysql_priv.h:1987:       LOCK_bytes_sent, LOCK_bytes_received, LOCK_connection_count;
sql/mysqld.cc:587:              LOCK_crypt, LOCK_bytes_sent, LOCK_bytes_received,
sql/mysqld.cc:1349:  (void) pthread_mutex_destroy(&LOCK_bytes_sent);
sql/mysqld.cc:3469:  (void) pthread_mutex_init(&LOCK_bytes_sent,MY_MUTEX_INIT_FAST);
sql/net_serv.cc:93:extern pthread_mutex_t LOCK_bytes_sent , LOCK_bytes_received;

and with 5.0-bzr:

openxs@suse:/home2/openxs/bzr/mysql-5.0> grep -r -n LOCK_bytes_sent *
sql/mysql_priv.h:1357:       LOCK_bytes_sent, LOCK_bytes_received;
sql/mysqld.cc:544:              LOCK_crypt, LOCK_bytes_sent, LOCK_bytes_received,
sql/mysqld.cc:1274:  (void) pthread_mutex_destroy(&LOCK_bytes_sent);
sql/mysqld.cc:3112:  (void) pthread_mutex_init(&LOCK_bytes_sent,MY_MUTEX_INIT_FAST);
sql/net_serv.cc:96:extern pthread_mutex_t LOCK_bytes_sent , LOCK_bytes_received;
openxs@suse:/home2/openxs/bzr/mysql-5.0> grep -r -n LOCK_bytes_received *
sql/mysql_priv.h:1357:       LOCK_bytes_sent, LOCK_bytes_received;
sql/mysqld.cc:544:              LOCK_crypt, LOCK_bytes_sent, LOCK_bytes_received,
sql/mysqld.cc:1275:  (void) pthread_mutex_destroy(&LOCK_bytes_received);
sql/mysqld.cc:3113:  (void) pthread_mutex_init(&LOCK_bytes_received,MY_MUTEX_INIT_FAST);
sql/net_serv.cc:96:extern pthread_mutex_t LOCK_bytes_sent , LOCK_bytes_received;
[23 Aug 2008 23:32] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/52384

2684 Marc Alff	2008-08-23
      Bug#38968 (Unused mutex LOCK_bytes_sent, LOCK_bytes_received)
      
      Removed the unused mutexes LOCK_bytes_sent and LOCK_bytes_received.
[25 Aug 2008 22:06] Kristofer Pettersson
OK by me. Stats should be collected by a unified systems as far as i know.
[1 Nov 2008 18:31] Bugs System
Pushed into 6.0.7-alpha  (revid:marc.alff@sun.com-20080823233216-r9blac0wsvsc56v3) (version source revid:marc.alff@sun.com-20080826003843-alvk2j1rxnpf76nc) (pib:5)
[3 Nov 2008 2:00] Paul DuBois
Cosmetic change. No changelog entry needed.
[29 Oct 2009 15:24] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/88620

2931 Marc Alff	2009-10-29
      Bug#38968 Unused mutex LOCK_bytes_sent, LOCK_bytes_received
      
      Backport for 5.5
[31 Oct 2009 8:17] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091031081410-qkxmjsdzjmj840aq) (version source revid:marc.alff@sun.com-20091029213317-ct3xfflphozct2r8) (merge vers: 6.0.14-alpha) (pib:13)
[31 Oct 2009 17:50] Paul DuBois
Already fixed in earlier 6.0.x.

Setting report to NDI pending push to 5.5.x.
[4 Nov 2009 18:52] Marc ALFF
Merged in 5.5.0, in mysql-next-mr
[5 Nov 2009 1:47] Paul DuBois
Cosmetic change. No changelog entry needed.
[12 Nov 2009 8:21] Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091110093229-0bh5hix780cyeicl) (version source revid:mikael@mysql.com-20091102100915-a2nbfxaqprpgptfw) (merge vers: 5.5.0-beta) (pib:13)