[Tarantool-patches] [PATCH 12/17] recovery: recovery_stop_local -- don't throw exception
Cyrill Gorcunov
gorcunov at gmail.com
Tue Apr 28 19:11:32 MSK 2020
Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
src/box/box.cc | 3 ++-
src/box/recovery.cc | 5 +++--
src/box/recovery.h | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/box/box.cc b/src/box/box.cc
index 31c53a443..01ef3318f 100644
--- a/src/box/box.cc
+++ b/src/box/box.cc
@@ -2307,7 +2307,8 @@ local_recovery(const struct tt_uuid *instance_uuid,
break;
fiber_sleep(0.1);
}
- recovery_stop_local(recovery);
+ if (recovery_stop_local(recovery))
+ diag_raise();
if (recover_remaining_wals(recovery, &wal_stream.base, NULL, true) != 0)
diag_raise();
/*
diff --git a/src/box/recovery.cc b/src/box/recovery.cc
index 9ed42590c..1b5b51b7f 100644
--- a/src/box/recovery.cc
+++ b/src/box/recovery.cc
@@ -581,7 +581,7 @@ recovery_follow_local(struct recovery *r, struct xstream *stream,
return 0;
}
-void
+int
recovery_stop_local(struct recovery *r)
{
if (r->watcher) {
@@ -589,8 +589,9 @@ recovery_stop_local(struct recovery *r)
r->watcher = NULL;
fiber_cancel(f);
if (fiber_join(f) != 0)
- diag_raise();
+ return -1;
}
+ return 0;
}
/* }}} */
diff --git a/src/box/recovery.h b/src/box/recovery.h
index a8cfa27d1..5e2826fee 100644
--- a/src/box/recovery.h
+++ b/src/box/recovery.h
@@ -82,7 +82,7 @@ int
recovery_follow_local(struct recovery *r, struct xstream *stream,
const char *name, ev_tstamp wal_dir_rescan_delay);
-void
+int
recovery_stop_local(struct recovery *r);
int
--
2.20.1
More information about the Tarantool-patches
mailing list