This is regarding failures in unregister_remote_update_watcher() and
unregister_local_update_watcher(). handle_replay_complete() can't be
called in these cases anymore as it would blindly attempt to unregister
watchers from scratch again. Dropping handle_replay_complete() calls
there means that these failures would only be logged and would not be
surfaced by snapshot replayer. But the only caller ignores them
anyway:
void ImageReplayer<I>::shut_down(int r) {
...
// close the replayer
if (m_replayer != nullptr) {
ctx = new LambdaContext([this, ctx](int r) {
m_replayer->destroy();
m_replayer = nullptr;
ctx->complete(0); <------
});
ctx = new LambdaContext([this, ctx](int r) {
m_replayer->shut_down(ctx);
});
}
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
C_SaferCond shutdown_ctx;
mock_replayer.shut_down(&shutdown_ctx);
- ASSERT_EQ(-EINVAL, shutdown_ctx.wait());
+ ASSERT_EQ(0, shutdown_ctx.wait());
}
TEST_F(TestMockImageReplayerSnapshotReplayer, UnregisterLocalUpdateWatcherError) {
C_SaferCond shutdown_ctx;
mock_replayer.shut_down(&shutdown_ctx);
- ASSERT_EQ(-EINVAL, shutdown_ctx.wait());
+ ASSERT_EQ(0, shutdown_ctx.wait());
}
TEST_F(TestMockImageReplayerSnapshotReplayer, LoadImageMetaError) {
if (r < 0) {
derr << "failed to unregister remote update watcher: " << cpp_strerror(r)
<< dendl;
- handle_replay_complete(
- r, "failed to unregister remote image update watcher");
}
unregister_local_update_watcher();
if (r < 0) {
derr << "failed to unregister local update watcher: " << cpp_strerror(r)
<< dendl;
- handle_replay_complete(
- r, "failed to unregister local image update watcher");
}
delete m_update_watch_ctx;