Bug #29063 mgmapi: connect timeout set incorrectly
Submitted: 13 Jun 2007 2:59 Modified: 19 Jun 2007 12:08
Reporter: Stewart Smith Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:5.1.4-a_drop6p8, 5.1.19 OS:Any
Assigned to: Stewart Smith CPU Architecture:Any

[13 Jun 2007 2:59] Stewart Smith
Description:
In ndb_mgm_connect, the connect timeout is set as follows:

s.set_connect_timeout(handle->timeout);
sockfd = s.connect();

which seems strange to me, because we set it in millisecs through ndb_mgm_set_timeout, and the connect() method seems to interpret that in seconds. 

How to repeat:
s.set_connect_timeout(handle->timeout);
sockfd = s.connect();

Suggested fix:
don't do the wrong thing. naughty, naughty API.
[13 Jun 2007 5:57] Stewart Smith
Test case

Attachment: bug29063_mgmapi_connect_test.patch (text/x-patch), 2.78 KiB.

[13 Jun 2007 5:57] Stewart Smith
patch

Attachment: bug29063_connect_timeout.patch (text/x-patch), 706 bytes.

[13 Jun 2007 6:04] Stewart Smith
patch v2 - round up

Attachment: bug29063_connect_timeout.patch (text/x-patch), 712 bytes.

[13 Jun 2007 12:49] 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/28655

ChangeSet@1.2144, 2007-06-13 22:49:10+10:00, stewart@flamingspork.com +2 -0
  [PATCH] BUG#29063 TESTCASE mgmapi: connect timeout set incorrectly
  
  Add test to testMgm for Connect timeout. add to autotest.
  
  Index: mysql-5.1-wl2325-5.0-drop6/storage/ndb/test/ndbapi/testMgm.cpp
  ===================================================================
[13 Jun 2007 12:49] 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/28656

ChangeSet@1.2145, 2007-06-13 22:49:20+10:00, stewart@flamingspork.com +1 -0
  [PATCH] BUG#29063 mgmapi: connect timeout set incorrectly
  
  correctly divide timeout by 1000 to convert to seconds for SocketClient
  
  Index: mysql-5.1-wl2325-5.0-drop6/storage/ndb/src/mgmapi/mgmapi.cpp
  ===================================================================
[13 Jun 2007 12:54] 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/28657

ChangeSet@1.2535, 2007-06-13 22:54:00+10:00, stewart@flamingspork.com +2 -0
  [PATCH] BUG#29063 TESTCASE mgmapi: connect timeout set incorrectly
  
  Add test to testMgm for Connect timeout. add to autotest.
  
  Index: ndb-work/storage/ndb/test/ndbapi/testMgm.cpp
  ===================================================================
[13 Jun 2007 12:54] 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/28658

ChangeSet@1.2536, 2007-06-13 22:54:14+10:00, stewart@flamingspork.com +1 -0
  [PATCH] BUG#29063 mgmapi: connect timeout set incorrectly
  
  correctly divide timeout by 1000 to convert to seconds for SocketClient
  
  Index: ndb-work/storage/ndb/src/mgmapi/mgmapi.cpp
  ===================================================================
[13 Jun 2007 12:55] Stewart Smith
tomas raised no objections.

pushed to: mysql-5.1-wl2325-5.0-drop6 version: 5.2.1-a_drop6p8
pushed to: mysql-5.1-ndb  version: 5.1.19-beta
[15 Jun 2007 8:35] Jon Stephens
Note to myself: Document fix for Bug #28847 when this one hits Doc status.
[18 Jun 2007 7:48] Bugs System
Pushed into 5.1.20-beta
[19 Jun 2007 12:08] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Documented bugfix in 5.1.20 changelog.
[3 Jul 2007 4:53] Jon Stephens
Also documented for telco-6.2.3 release.