From 2d99476bb1c591937a2b89d21d417d9ddfc4ebe7 Mon Sep 17 00:00:00 2001 From: Asias He Date: Wed, 16 Sep 2015 17:59:54 +0800 Subject: [PATCH] storage_service: Fix schedule_schema_pull It might block for a very long time. Don't wait for it otherwise it will block the whole gossip round. --- service/storage_service.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/service/storage_service.cc b/service/storage_service.cc index 074c612245..ed6776d643 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -632,12 +632,16 @@ void storage_service::on_join(gms::inet_address endpoint, gms::endpoint_state ep for (auto e : ep_state.get_application_state_map()) { on_change(endpoint, e.first, e.second); } - get_local_migration_manager().schedule_schema_pull(endpoint, ep_state).get(); + get_local_migration_manager().schedule_schema_pull(endpoint, ep_state).handle_exception([endpoint] (auto ep) { + logger.warn("Fail to pull schmea from {}: {}", endpoint, ep); + }); } void storage_service::on_alive(gms::inet_address endpoint, gms::endpoint_state state) { logger.debug("on_alive endpoint={}", endpoint); - get_local_migration_manager().schedule_schema_pull(endpoint, state).get(); + get_local_migration_manager().schedule_schema_pull(endpoint, state).handle_exception([endpoint] (auto ep) { + logger.warn("Fail to pull schmea from {}: {}", endpoint, ep); + }); if (_token_metadata.is_member(endpoint)) { #if 0 HintedHandOffManager.instance.scheduleHintDelivery(endpoint, true); @@ -684,7 +688,9 @@ void storage_service::on_change(inet_address endpoint, application_state state, } do_update_system_peers_table(endpoint, state, value); if (state == application_state::SCHEMA) { - get_local_migration_manager().schedule_schema_pull(endpoint, *ep_state).get(); + get_local_migration_manager().schedule_schema_pull(endpoint, *ep_state).handle_exception([endpoint] (auto ep) { + logger.warn("Fail to pull schmea from {}: {}", endpoint, ep); + }); } } replicate_to_all_cores().get();