summaryrefslogtreecommitdiff
path: root/mysql-test/lib/My/SafeProcess.pm
diff options
context:
space:
mode:
authorBjorn Munch <Bjorn.Munch@sun.com>2009-04-08 14:54:36 +0200
committerBjorn Munch <Bjorn.Munch@sun.com>2009-04-08 14:54:36 +0200
commitc43af0353e5db4035d54b65a9a1f58b7dff1d0d6 (patch)
tree58b1abcd17568f8d3d0057ac2727a914f8f6ed97 /mysql-test/lib/My/SafeProcess.pm
parentedbfc0cb16b5906785e49b2826b9bcf37fd78f70 (diff)
downloadmariadb-git-c43af0353e5db4035d54b65a9a1f58b7dff1d0d6.tar.gz
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
Diffstat (limited to 'mysql-test/lib/My/SafeProcess.pm')
-rw-r--r--mysql-test/lib/My/SafeProcess.pm18
1 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/lib/My/SafeProcess.pm b/mysql-test/lib/My/SafeProcess.pm
index 5ef3286ad8e..17868a92c66 100644
--- a/mysql-test/lib/My/SafeProcess.pm
+++ b/mysql-test/lib/My/SafeProcess.pm
@@ -537,6 +537,24 @@ sub wait_any {
}
#
+# Check if any process has exited, but don't wait.
+#
+# Returns a reference to the SafeProcess that
+# exited or undefined
+#
+sub check_any {
+ for my $proc (values %running){
+ if ( $proc->is_child($$) ) {
+ if (not $proc->wait_one(0)) {
+ _verbose ("Found exited $proc");
+ return $proc;
+ }
+ }
+ }
+ return undef;
+}
+
+
# Overload string operator
# and fallback to default functions if no
# overloaded function is found