Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
66b42a13
Commit
66b42a13
authored
Aug 09, 2008
by
Magnus Svensson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make events_restart more stable by waiting for the server to be stopped before starting it again
parent
02e48e88
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
8 deletions
+47
-8
client/mysqltest.cc
client/mysqltest.cc
+1
-1
mysql-test/include/restart_mysqld.inc
mysql-test/include/restart_mysqld.inc
+10
-2
mysql-test/lib/mtr_io.pl
mysql-test/lib/mtr_io.pl
+13
-1
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+23
-4
No files found.
client/mysqltest.cc
View file @
66b42a13
...
@@ -4174,7 +4174,7 @@ void do_shutdown_server(struct st_command *command)
...
@@ -4174,7 +4174,7 @@ void do_shutdown_server(struct st_command *command)
/* Check that server dies */
/* Check that server dies */
while
(
timeout
--
){
while
(
timeout
--
){
if
(
my_kill
(
0
,
pid
)
<
0
){
if
(
my_kill
(
0
,
pid
)
<
0
){
DBUG_PRINT
(
"info"
,
(
"
Sleeping, timeout: %d"
,
timeout
));
DBUG_PRINT
(
"info"
,
(
"
Process %d does not exist anymore"
,
pid
));
break
;
break
;
}
}
DBUG_PRINT
(
"info"
,
(
"Sleeping, timeout: %d"
,
timeout
));
DBUG_PRINT
(
"info"
,
(
"Sleeping, timeout: %d"
,
timeout
));
...
...
mysql-test/include/restart_mysqld.inc
View file @
66b42a13
# Write file to make mysql-test-run.pl expect crash and restart
# Write file to make mysql-test-run.pl expect the "crash", but don't start
# it until it's told to
--
write_file
$MYSQLTEST_VARDIR
/
tmp
/
mysqld
.
1.
expect
--
write_file
$MYSQLTEST_VARDIR
/
tmp
/
mysqld
.
1.
expect
restar
t
wai
t
EOF
EOF
# Send shutdown to the connected server and give
# Send shutdown to the connected server and give
# it 10 seconds to die before zapping it
# it 10 seconds to die before zapping it
shutdown_server
10
;
shutdown_server
10
;
# Check server is gone
--
source
include
/
wait_until_disconnected
.
inc
# Write file to make mysql-test-run.pl start up the server again
--
append_file
$MYSQLTEST_VARDIR
/
tmp
/
mysqld
.
1.
expect
restart
EOF
# Turn on reconnect
# Turn on reconnect
--
enable_reconnect
--
enable_reconnect
...
...
mysql-test/lib/mtr_io.pl
View file @
66b42a13
...
@@ -26,7 +26,7 @@ sub mtr_tonewfile($@);
...
@@ -26,7 +26,7 @@ sub mtr_tonewfile($@);
sub
mtr_appendfile_to_file
($$);
sub
mtr_appendfile_to_file
($$);
sub
mtr_grab_file
($);
sub
mtr_grab_file
($);
sub
mtr_printfile
($);
sub
mtr_printfile
($);
sub
mtr_lastlinefromfile
($);
# Read a whole file, stripping leading and trailing whitespace.
# Read a whole file, stripping leading and trailing whitespace.
sub
mtr_fromfile
($)
{
sub
mtr_fromfile
($)
{
...
@@ -94,5 +94,17 @@ sub mtr_printfile($) {
...
@@ -94,5 +94,17 @@ sub mtr_printfile($) {
return
;
return
;
}
}
sub
mtr_lastlinefromfile
($)
{
my
$file
=
shift
;
my
$text
;
open
(
FILE
,"
<
",
$file
)
or
mtr_error
("
can't open file
\"
$file
\"
: $!
");
while
(
my
$line
=
<
FILE
>
)
{
$text
=
$line
;
}
close
FILE
;
return
$text
;
}
1
;
1
;
mysql-test/mysql-test-run.pl
View file @
66b42a13
...
@@ -3320,10 +3320,29 @@ sub check_expected_crash_and_restart {
...
@@ -3320,10 +3320,29 @@ sub check_expected_crash_and_restart {
my
$expect_file
=
"
$opt_vardir
/tmp/
"
.
$mysqld
->
name
()
.
"
.expect
";
my
$expect_file
=
"
$opt_vardir
/tmp/
"
.
$mysqld
->
name
()
.
"
.expect
";
if
(
-
f
$expect_file
)
if
(
-
f
$expect_file
)
{
{
mtr_report
("
Crash was expected, file '
$expect_file
' exists
");
mtr_verbose
("
Crash was expected, file '
$expect_file
' exists
");
while
(
1
){
# If last line in expect file starts with "wait"
# sleep a little and try again, thus allowing the
# test script to control when the server should start
# up again
my
$last_line
=
mtr_lastlinefromfile
(
$expect_file
);
if
(
$last_line
=~
/^wait/
)
{
mtr_verbose
("
Test says wait before restart
");
mtr_milli_sleep
(
100
);
next
;
}
unlink
(
$expect_file
);
# Start server with same settings as last time
# Start server with same settings as last time
mysqld_start
(
$mysqld
,
$mysqld
->
{'
started_opts
'});
mysqld_start
(
$mysqld
,
$mysqld
->
{'
started_opts
'});
unlink
(
$expect_file
);
last
;
}
}
}
return
1
;
return
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment