Merge branch '37-unexplained-mirror-timeout-causing-migrations-to-stall' into 'develop'
Resolve "Unexplained mirror timeout causing migrations to stall" Closes #37 See merge request open-source/flexnbd-c!59
This commit is contained in:
2
debian/changelog
vendored
2
debian/changelog
vendored
@@ -2,6 +2,8 @@ flexnbd (0.4.0) UNRELEASED; urgency=medium
|
|||||||
|
|
||||||
* Explicitly close the server control socket, and wait for it to close, to
|
* Explicitly close the server control socket, and wait for it to close, to
|
||||||
prevent deadlocks during the server clean-up process (#40 !58)
|
prevent deadlocks during the server clean-up process (#40 !58)
|
||||||
|
* Ensure mirroring can be restarted after a break command is sent to the
|
||||||
|
source (#37, !59)
|
||||||
|
|
||||||
-- Patrick J Cherry <patrick@bytemark.co.uk> Fri, 07 Dec 2018 16:38:56 +0000
|
-- Patrick J Cherry <patrick@bytemark.co.uk> Fri, 07 Dec 2018 16:38:56 +0000
|
||||||
|
|
||||||
|
@@ -671,6 +671,7 @@ static void mirror_abandon_cb(struct ev_loop *loop, ev_io * w, int revents)
|
|||||||
debug("Abandon message received");
|
debug("Abandon message received");
|
||||||
mirror_set_state(ctrl->mirror, MS_ABANDONED);
|
mirror_set_state(ctrl->mirror, MS_ABANDONED);
|
||||||
self_pipe_signal_clear(ctrl->mirror->abandon_signal);
|
self_pipe_signal_clear(ctrl->mirror->abandon_signal);
|
||||||
|
ev_io_stop(loop, &ctrl->abandon_watcher);
|
||||||
ev_break(loop, EVBREAK_ONE);
|
ev_break(loop, EVBREAK_ONE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -86,6 +86,14 @@ class TestWriteDuringMigration < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def stop_mirror
|
||||||
|
UNIXSocket.open(@source_sock) do |sock|
|
||||||
|
sock.write("break\x0A\x0A")
|
||||||
|
sock.flush
|
||||||
|
sock.readline
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def wait_for_quit
|
def wait_for_quit
|
||||||
Timeout.timeout(10) do
|
Timeout.timeout(10) do
|
||||||
Process.waitpid2(@dst_proc)
|
Process.waitpid2(@dst_proc)
|
||||||
@@ -177,7 +185,6 @@ class TestWriteDuringMigration < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def test_status_call_after_cleanup
|
def test_status_call_after_cleanup
|
||||||
Dir.mktmpdir do |tmpdir|
|
Dir.mktmpdir do |tmpdir|
|
||||||
Dir.chdir(tmpdir) do
|
Dir.chdir(tmpdir) do
|
||||||
@@ -195,4 +202,28 @@ class TestWriteDuringMigration < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_mirroring_can_be_restarted
|
||||||
|
@size = 100 * 1024 * 1024 # 100MB
|
||||||
|
Dir.mktmpdir do |tmpdir|
|
||||||
|
Dir.chdir(tmpdir) do
|
||||||
|
make_files
|
||||||
|
|
||||||
|
launch_servers
|
||||||
|
|
||||||
|
# This is a bit racy. It needs to be slow enough that the migration
|
||||||
|
# isn't finished before the stop runs, and slow enough so that we can
|
||||||
|
# stop/start a few times.
|
||||||
|
3.times do
|
||||||
|
start_mirror
|
||||||
|
sleep 0.1
|
||||||
|
stop_mirror
|
||||||
|
sleep 0.1
|
||||||
|
end
|
||||||
|
start_mirror
|
||||||
|
|
||||||
|
wait_for_quit
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user