Commit graph

109 commits

Author SHA1 Message Date
Vladislav Vaintroub
5f80994f4e Bug #47731 mtr freezes for many seconds when process to be killed has already gone.
The problem is that safe_kill_win fails to detect a dead process. OpenProcess() will 
succeed even after the process died, it will first fail after the last handle to process 
is closed.

To fix the problem, check process status with GetExitCodeProcess() and consider 
process to be dead if the exit code returned by this routine is not STILL_ALIVE.
2009-09-30 00:19:00 +02:00
Bjorn Munch
51c0f1fce6 3rd merge from main 2009-09-03 08:44:22 +02:00
Bjorn Munch
588e9930b4 first merge from main 2009-09-02 18:58:17 +02:00
Jonathan Perkin
4a76122f43 Apply patch from bug#46834 to install the test suite in RPMs. 2009-08-21 13:58:33 +02:00
Bjorn Munch
e4b2b97839 Bug #45771 AIX and i5/OS Perl bug: check_socket_path_length in MTR fails
Bug in Perl
Scrap attempt to do this smartly on AIX, just drop the test and assume it's OK
This commit undoes the previous push and adds a line to ignore on AIX
2009-08-06 09:30:53 +02:00
Bjorn Munch
c26dd8e87b Bug #45771 AIX and i5/OS Perl bug: check_socket_path_length in MTR fails
Bug is actually in Perl
Fixed by trapping and ignoring error from IO::Socket::UNIX
2009-08-05 09:41:40 +02:00
Bjorn Munch
2399987a2a Bug #46212 safe_process: FATAL ERROR, Unknown option: --nocore
Also fixed mysqld.cc to avoid popup-boxes
2009-07-23 19:01:24 +02:00
Bjorn Munch
8d6a25a23f Bug #43005 main.init_connect fais on Windows in PB2
Server args containing spaces do not work on Windows
Fixed my_safe_rprocess-win to re-apply "" around such args
2009-07-15 14:20:56 +02:00
Davi Arnaut
915d1c4d32 Fix warnings generated by SunStudio and GCC.
Based upon patch contributed by Stewart Smith
2009-07-08 09:31:22 -03:00
Bjorn Munch
63910fc2a0 Bug #43780 mysql-test-run uses deprecated server options
Updated to use general_log[_file] and slow_query_log[_file]
2009-06-22 16:27:05 +02:00
Vladislav Vaintroub
efb195051a Bug #44775 MTR fails to bootstrap mysqld on Windows in Pushbuild 2.
Suspected reason for the failure is that safe_process.exe already runs in a job that does not allow breakaways. 
The fix is to use a fallback -  make newly created process the root of the new process group. This allows to kill process together with descendants via GenerateConsoleCtrlEvent (CTRL_BREAK_EVENT, pid)
2009-05-14 21:56:53 +02:00
Bjorn Munch
a4252ac0c7 Bug #44511 MTR2: add an option not to kill other servers when one from the group exits
MTR would die as soon as one server terminates
Implemented --wait-all option and associated subroutine
2009-04-29 16:13:38 +02:00
Vladislav Vaintroub
361fa97258 Bug #42804 --parallel option does not work for MTR under ActiveState
perl 

The problem here was the method how MTR gets its unique thread ids.
Prior to this patch, the method to do it was to maintain a global 
table of pid,mtr_unique_id) pairs. The table was backed by a text 
file. The table was cleaned up one in a while and dead processes leaking
unique_ids were determined with with kill(0) or with scripting tasklist
on Windows.

This method is flawed specifically on native Windows Perl. fork() is 
implemented with starting a new thread, give it a syntetic negative PID
(threadID*(-1)), until this thread creates a new process with exec()
However,  neither tasklist nor any other native Windows tool can cope with
negative perl PIDs. This lead to incorrect determination of dead process 
and reusing already used mtr_unique_id.

The patch introduces alternative portable  method of solving unique-id 
problem. When a process needs a unique id in range [min...max], it just 
starts  to open files named min, min+1,...max in a loop . After file is 
opened, we do non-blocking flock(). When flock() succeeds, process has 
allocated the ID. When process dies, file is unlocked . Checks for zombies 
are not necessary.

Since the change would create a co-existence problems with older version
of MTR, because of different way to calculate IDs, the default ID range
is changed from 250-299 to 300-349.

Another fix that was necessary enable --parallel option was to serialize 
spawn() calls on Windows. specifically, IO redirects needed to be protected.

This patch also fixes hanging CRTL-C (as described in Bug #38629) for the
"new"  MTR. The fix was already in 6.0 and is now downported.
2009-04-23 13:35:02 +02:00
Bjorn Munch
0f7e647944 Bug #41649 sporadic pb failure: mtr stopped, message "TIMEOUT (1200 seconds), ABORTING."
Potentially infinite loop in check_expected_crash_and_restart 
Replace with finite loop and some additional logic
2009-04-08 14:54:36 +02:00
Bjorn Munch
0fcfab24d7 Bug #43570 MTR2 hangs when test fails and named pipe created
Hangs when trying to copy the pipe
Amend copytree() to only copy regular files
2009-04-01 16:23:10 +02:00
Vladislav Vaintroub
b446a256e4 change order of cdb parameters to workaround a bug , where command (-c) is not evaluated if -i ,-y or -z contains an invalid path.
cdb would hang then waiting for user input, which is bad for use in scripts
2009-03-24 14:44:21 +01:00
Bjorn Munch
ca3db65c9f Bug #43074 MTR2 is not accessing core dumps when a path is too long
Executable path is truncated in core
If we see truncated path, try to guess using strings and grep
If that doesn't work either, use known mysqld path
2009-03-20 16:39:06 +01:00
Bjorn Munch
1b922ca6e8 merge from main 2009-03-18 13:44:05 +01:00
Bjorn Munch
6f7f233b6c Bug #43597 Fix for Bug 43410 breaks build on Power Mac due to incomplete sys/resource.h
Added include of sys/time.h
2009-03-12 16:07:13 +01:00
Georgi Kodinov
68fcdd97da merged 5.1-main -> 5.1-bugteam 2009-03-11 15:03:25 +02:00
Bjorn Munch
8179ed2649 Bug #43410 --skip-core-file has no effect if core file size is set
Would not prevent mysqld from core dumping
Passes --nocore arg to safe_process, which then sets rlimit core to 0 for child
2009-03-09 14:31:39 +01:00
Bjorn Munch
0314eb7e40 Bug #40978 Error log gets truncated during testsuite, prevents debugging
Error log gets truncated when mysqld is restarted by MTR
2009-03-02 13:48:35 +01:00
Bjorn Munch
0f33682fa4 Bug #43172 MTR leaves test files in /tmp after check_socket_path_length finds path too long
Faulty logic in cleanup
Put test file into tmpdir, cleanup by removing tmpdir
2009-02-25 10:32:13 +01:00
Vladislav Vaintroub
b7393ba5ce Bug#42788 lib\My\CoreDump.pm needs to be ported for Windows.
- output callstacks from crash using cdb debugger which is part 
of "Debugging Tools for Windows". Output  other interesting 
information - function parameters, possibly source code fragment
and other goodies of  "!analyze" cdb extension.
2009-02-12 17:13:56 +01:00
Vladislav Vaintroub
2980cd60db Bug#42709: safe_process_win.cc does not print correct system error messages.
Fix: use FormatMessage() to output system errors , not strerror()
2009-02-09 19:24:48 +01:00
Magnus Svensson
e1510d5aa8 Bug#42641 mtr.pl fails to run within JobObject
- Allow the new process to break away from any job that this
   process is part of so that it can be assigned to the new JobObject
   we just created. This is safe since the new JobObject is created with
   the JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE flag, making sure it will be
   terminated when the last handle to it is closed(which is owned by
   this process).
2009-02-06 08:38:24 +01:00
Magnus Svensson
d4c402db64 Merge 2009-01-27 15:10:15 +01:00
Magnus Svensson
d850730333 WL#4189 mtr.pl v2
- Add a "skip-ssl=1" to [mysqltest] section so that 
   mysqltest will not run with ssl turned on by default 
   but stil be able to turn it on when requested
 - This avoids that check_warnings and check_testcase
   connects to the server woth SSL turned on
2009-01-27 14:21:18 +01:00
Magnus Svensson
db72d0dbf5 mtr.pl v2
- extend debug prints for "permission denied"
2009-01-24 15:07:57 +01:00
Magnus Svensson
1f724b9ddd WL#4189 mtr.pl v2
- fix typo
2009-01-24 13:00:50 +01:00
Magnus Svensson
2f5ffdfa76 mtr.pl v2
- Add debug prints for analyzing mkdir "Permission denied" failure
2009-01-24 11:05:38 +01:00
Magnus Svensson
e1e296bbf8 Bug#35735 mysql-test-run.pl creates tmpdir for socket path longer than 70
- Additional patch with improved protection by putting it all inside an "eval"
 - Calling 'hostpath' on a truncated socket may also croak.
 - Remove the need to create any directory parts of "path" inside the function.
2009-01-21 18:18:03 +01:00
Bjorn Munch
8a0c984f01 Bug #40399 Please make mtr print stack trace after every failure
SIGABRT is sent to relevant processes after a timeout
2009-01-21 10:34:01 +01:00
Sven Sandberg
28a68906d1 BUG#41959: mtr: error message when mkpath() fails and the file exists but is not directory
Problem: when mtr tries to create a directory, and the target
exists but is a file instead of directory, it tries several times
to create the directory again before it fails.
Fix: make it check if the target exists and is a non-directory.
2009-01-08 14:28:40 +01:00
Magnus Svensson
fdd665443c Bug#41480 Tests that do LOAD DATA INFILE fail when run locally 2008-12-18 13:58:55 +01:00
Magnus Svensson
4e98cbab0d Bug#40715 mtr fails when running the same test case in parallel threads 2008-11-14 11:49:12 +01:00
Sven Sandberg
746734d974 BUG#38817: please make mtr analyze crashes better
Post-push fixes making it work on pushbuild's valgrind host, and clarifying the output.
2008-10-13 18:14:30 +02:00
Magnus Svensson
b7967587e6 WL#4189 Set parallel to 1 if running under vmware on windows 2008-10-11 17:30:26 +02:00
Magnus Svensson
f0ed343ba4 WL#4189 Add retry logic to mkpath to avoid temporary permission denied problems 2008-10-11 17:06:34 +02:00
Magnus Svensson
260c3491a9 WL#41890 After review fixes, remove unecessary if's 2008-10-10 09:19:19 +02:00
Magnus Svensson
cc08b5cd85 Merge 2008-10-08 22:43:37 +02:00
Magnus Svensson
2359d44c61 Merge 2008-10-08 22:30:56 +02:00
Magnus Svensson
956c109c0f BUG#38559 Annoying cygwin problem fixed by resolving pid->winpid before kill instead of just after fork 2008-10-08 22:06:10 +02:00
Magnus Svensson
c2858e8b5b WL#4189 NO need to retry OpenEvent if the process does not exist anymore 2008-10-08 22:02:32 +02:00
Magnus Svensson
5b8771ea3a WL4189 Active state perl fixes 2008-10-08 20:25:28 +02:00
Magnus Svensson
870699c9f7 WL#4189 Only kill process that hasn't yet finished at end of mtr.pl. Improve debug printout 2008-10-06 19:52:26 +02:00
Magnus Svensson
ab5c044e4d WL4189 Add Handles.pm and use it from My::File::Path to show open handles. Rewrite rmtree to use File::Find so we can get better debug printouts when something fails 2008-10-06 19:51:33 +02:00
Magnus Svensson
c84dfbbd6a Improve gdb coredump 2008-10-06 10:49:12 +02:00
Magnus Svensson
13e6758df0 Memoize functions that converts between different paths, a given input string will always return the same output. This save a lot of calls to cygpath for example 2008-09-22 19:15:55 +03:00
Magnus Svensson
c955eb6b68 Print 'cygpath -m' command if it fails 2008-09-22 18:44:35 +03:00