Bug #12776 Delayed launch of mysqld-nt.exe on Win2K
Submitted: 24 Aug 2005 6:41 Modified: 6 Sep 2005 22:16
Reporter: David Rodgers Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / MXJ Severity:S3 (Non-critical)
Version:connector-mxj-gpl-1-1-3 OS:Windows (Win2K)
Assigned to: Eric Herman CPU Architecture:Any

[24 Aug 2005 6:41] David Rodgers
Description:
There is about a 30sec delay in the launch of the mysqld-nt.exe server process on Win2K.
Looked at source (MysqldResource.java) and saw that it was looking for the string
"ready for connections" in TeeOutputStream.  
This was not appearing on console by default on Win2K, but was printing on Solaris and Linux.

Did experiment:  launch manually with --console and got the "ready for connections" msg.

Tried using MysqldResource API with options.put("console", "true") but it does not
have the desired result as it just sends --console=true to server, which it does not understand.
 
Added following line to MysqldResource.java method constructArgs(Map mysqldArgs):
strs.add("--console");

That solved the problem, although it might not be the final solution.

How to repeat:
Very repeatable, just launch the default test program.
Once a connection is obtained, do something programmatically immediately.
There will be the delay.

Suggested fix:
See earlier description for possible fix.
[24 Aug 2005 11:17] David Rodgers
The delay is actually after the mysqld process launches, as the launching wrapper
waits for the expected message.
[24 Aug 2005 23:22] Eric Herman
Wonderful detective work, David! 

I have tested on Windows XP and Windows 2000 and have not seen an error arise from not including the "--console" option ... so I remain unclear as to what remains different between your system and our systems. 

However, it is certainly easy enough to add in the option (nearly exactly as you have described), and I've done so. This will be included in the next release.

For future reference, any arguments in the options map with a value of "null" will be added to the command line without an equals sign.

args.put("foo", "moo"); args.put("bar", null);

will result in:

--foo=moo --bar

Great work breaking open the source and coming up with the work-around!
 
-- Eric
[25 Aug 2005 4:25] David Rodgers
Thats great news Eric.  Any idea when the next
release of MXJ is expected to roll out?

Thanks,
Dave
[25 Aug 2005 5:36] David Rodgers
Hi Eric,

Now that you have told me the secret of the null data value 
(and I take a fresh look at the code) I can see that this was
all I needed to do do solve my problem (ie. options.put("console",null))

I've tested again without my patch on Win2K and its fine with the original
shipped jar file.  I got tricked into thinking that I had to supply a true or false
value when I did a getServerOptions() and the console option was FALSE.

So this is really turning into more of a documentation bug.
If the example code or text in section 1.6 of MySQL Connector/MXJ
document will mention the possibility of the null value for command
line options with no value, then it will help out future users of MXJ.

Great product BTW, I thought it was quite a clever way to ship
 multi-platform support in a jar file.
Dave
[6 Sep 2005 22:16] Eric Herman
fixed in 1-1-6