Replace some throws with force_stop

nfs-proxy-old
Vitaliy Filippov 2022-02-19 19:36:56 +03:00
parent 951272f27f
commit 7cbfdff41a
2 changed files with 7 additions and 3 deletions

View File

@ -457,7 +457,8 @@ void osd_t::renew_lease()
if (err == "" && data["result"]["TTL"].string_value() == "") if (err == "" && data["result"]["TTL"].string_value() == "")
{ {
// Die // Die
throw std::runtime_error("etcd lease has expired"); fprintf(stderr, "Error refreshing etcd lease\n");
force_stop(1);
} }
if (err != "") if (err != "")
{ {
@ -466,7 +467,8 @@ void osd_t::renew_lease()
if (etcd_failed_attempts > st_cli.max_etcd_attempts) if (etcd_failed_attempts > st_cli.max_etcd_attempts)
{ {
// Die // Die
throw std::runtime_error("Cluster connection failed"); fprintf(stderr, "Cluster connection failed\n");
force_stop(1);
} }
// Retry // Retry
tfd->set_timer(st_cli.etcd_quick_timeout, false, [this](int timer_id) tfd->set_timer(st_cli.etcd_quick_timeout, false, [this](int timer_id)

View File

@ -396,7 +396,9 @@ void osd_t::submit_list_subop(osd_num_t role_osd, pg_peering_state_t *ps)
{ {
if (op->bs_op->retval < 0) if (op->bs_op->retval < 0)
{ {
throw std::runtime_error("local OP_LIST failed"); printf("Local OP_LIST failed: retval=%d\n", op->bs_op->retval);
force_stop(1);
return;
} }
add_bs_subop_stats(op); add_bs_subop_stats(op);
printf( printf(