Commit graph

113 commits

Author SHA1 Message Date
Bjorn Munch
0632e9a407 merge from next-mr 2009-10-21 12:18:33 +02:00
Sergey Glukhov
d8c3f2263f WL#751 Error message construction, backport 2009-10-15 17:23:43 +05:00
Vladislav Vaintroub
017a0fd20d 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
bb181d25cb new merge from trunk 2009-09-21 11:43:01 +02:00
Bjorn Munch
29a142043e initial merge from 5.1-mtr 2009-09-04 15:20:58 +02:00
Bjorn Munch
3948eef1a1 3rd merge from main 2009-09-03 08:44:22 +02:00
Bjorn Munch
a829604260 first merge from main 2009-09-02 18:58:17 +02:00
Jonathan Perkin
769d9f3803 Apply patch from bug#46834 to install the test suite in RPMs. 2009-08-21 13:58:33 +02:00
Bjorn Munch
6ddeb379fe 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
47227d7f6a 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
a80bd0b5d7 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
6fed1e15c2 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
a56ab623ba Fix warnings generated by SunStudio and GCC.
Based upon patch contributed by Stewart Smith

mysql-test/lib/My/SafeProcess/safe_process.cc:
  Fix style -- remove unneeded spaces.
  Specify C linkage for the signal handling functions.
  Check return value from read()/write().
2009-07-08 09:31:22 -03:00
Bjorn Munch
a9b438b222 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
e3bdffe100 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
261066e251 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
2943d2b7e9 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
c43af0353e 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
c3a43bcaa6 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
37085905e5 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
dd6356acca 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
9f32fdd9e2 merge from main 2009-03-18 13:44:05 +01:00
Bjorn Munch
8b9502ae58 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
fb36c97705 merged 5.1-main -> 5.1-bugteam 2009-03-11 15:03:25 +02:00
Bjorn Munch
4cab491915 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
6293a2ea93 Bug #40978 Error log gets truncated during testsuite, prevents debugging
Error log gets truncated when mysqld is restarted by MTR

mysql-test/include/check-warnings.test:
  Since server doesn't have log-error, get it from env. var. set by MTR
mysql-test/lib/My/ConfigFactory.pm:
  "Hide" log-error in a comment
mysql-test/mysql-test-run.pl:
  "Hide" log-error in my.cnf by comment
  add --console to arguments on Windows
  Move .err file to var/log
2009-03-02 13:48:35 +01:00
Bjorn Munch
e0c6aad83a 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
34d066a21c 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
20e5719574 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
aca7ca6bba 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
8a73a4beca Merge 2009-01-27 15:10:15 +01:00
Magnus Svensson
b3e1ca1f2c 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
66bf048dd3 mtr.pl v2
- extend debug prints for "permission denied"
2009-01-24 15:07:57 +01:00
Magnus Svensson
0cb63777a7 WL#4189 mtr.pl v2
- fix typo
2009-01-24 13:00:50 +01:00
Magnus Svensson
0226941c09 mtr.pl v2
- Add debug prints for analyzing mkdir "Permission denied" failure
2009-01-24 11:05:38 +01:00
Magnus Svensson
c2a4f3901b 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
089663f9a7 Bug #40399 Please make mtr print stack trace after every failure
SIGABRT is sent to relevant processes after a timeout


client/mysqltest.cc:
  Fixed signal handlers to mysqltest actually dumps core
mysql-test/lib/My/CoreDump.pm:
  Added support for dbx
mysql-test/lib/My/SafeProcess.pm:
  Added dump_core to force process to dump core
mysql-test/lib/My/SafeProcess/safe_process.cc:
  Traps SIGABRT and sends this on to child
mysql-test/mysql-test-run.pl:
  When test times out, force core dumps on mysqltest and servers
2009-01-21 10:34:01 +01:00
Sven Sandberg
75017750c3 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.


mysql-test/lib/My/File/Path.pm:
  mkpath() now stops with appropriate error message if the target
  exists but is a non-directory.
2009-01-08 14:28:40 +01:00
Magnus Svensson
949b2f1c0c Bug#41480 Tests that do LOAD DATA INFILE fail when run locally
mysql-test/lib/My/File/Path.pm:
  Extend 'copytree' to take an optional "umask" parameter that will be used while copying the files
mysql-test/mysql-test-run.pl:
  Pass umask 0022 to copytree so that the copied files will be created world readable and the mysqld
  can LOAD DATA INFILE them
2008-12-18 13:58:55 +01:00
Magnus Svensson
950d5d2760 Bug#40715 mtr fails when running the same test case in parallel threads
mysql-test/lib/My/Test.pm:
  Use a more unique key to identify which test has been serialized
2008-11-14 11:49:12 +01:00
Sven Sandberg
906fc6bb95 BUG#38817: please make mtr analyze crashes better
Post-push fixes making it work on pushbuild's valgrind host, and clarifying the output.


mysql-test/lib/My/CoreDump.pm:
  - Improved parsing of mtr output so that it works on pushbuild's "valgrind" host.
  - Added stack trace for the thread that coredumped, to make output more readable when there are many threads.
  - Added explanation of what the output consists of.
  - Added early removal of temp file.
2008-10-13 18:14:30 +02:00
Magnus Svensson
770ef5c307 WL#4189 Set parallel to 1 if running under vmware on windows 2008-10-11 17:30:26 +02:00
Magnus Svensson
6a10718848 WL#4189 Add retry logic to mkpath to avoid temporary permission denied problems 2008-10-11 17:06:34 +02:00
Magnus Svensson
9ffab58506 WL#41890 After review fixes, remove unecessary if's 2008-10-10 09:19:19 +02:00
Magnus Svensson
7dca45f8b2 Merge 2008-10-08 22:43:37 +02:00
Magnus Svensson
ce9f585b48 Merge 2008-10-08 22:30:56 +02:00
Magnus Svensson
2d2387927a 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
fc6a7def0b WL#4189 NO need to retry OpenEvent if the process does not exist anymore 2008-10-08 22:02:32 +02:00
Magnus Svensson
e75daedf17 WL4189 Active state perl fixes 2008-10-08 20:25:28 +02:00
Magnus Svensson
160e13cb4c 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