1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Bug #44530 mtr v2 startup very slow on Windows.

MTR is stuck for about 20 seconds checking for free ports.
The reason is that perl's connect()  takes 1 second on windows
if port is not opened.

This patch fixes the mtr_ping_port implementation on Windows
to use Net::Ping for the port checking with small (0.1sec) timeout.

This patch also removes pointless second call to check_ports_free() 
in case of auto build thread.
This commit is contained in:
Vladislav Vaintroub
2009-04-28 23:06:36 +02:00
parent 361fa97258
commit 24e7fb05b5
2 changed files with 26 additions and 5 deletions

View File

@ -1344,14 +1344,13 @@ sub set_build_thread_ports($) {
else
{
$build_thread = $opt_build_thread + $thread - 1;
if (! check_ports_free($build_thread)) {
# Some port was not free(which one has already been printed)
mtr_error("Some port(s) was not free")
}
}
$ENV{MTR_BUILD_THREAD}= $build_thread;
if (! check_ports_free($build_thread)) {
# Some port was not free(which one has already been printed)
mtr_error("Some port(s) was not free")
}
# Calculate baseport
$baseport= $build_thread * 10 + 10000;
if ( $baseport < 5001 or $baseport + 9 >= 32767 )