From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id A081F4696C5 for ; Tue, 28 Apr 2020 19:14:21 +0300 (MSK) Received: by mail-lf1-f54.google.com with SMTP id u10so17376367lfo.8 for ; Tue, 28 Apr 2020 09:14:21 -0700 (PDT) From: Cyrill Gorcunov Date: Tue, 28 Apr 2020 19:11:32 +0300 Message-Id: <20200428161137.20536-13-gorcunov@gmail.com> In-Reply-To: <20200428161137.20536-1-gorcunov@gmail.com> References: <20200428161137.20536-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 12/17] recovery: recovery_stop_local -- don't throw exception List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml Signed-off-by: Cyrill Gorcunov --- 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