diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2016-12-20 10:03:23 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2016-12-20 10:03:23 +0100 |
commit | b4cdecba1d0fade26a70a082f3b8ec2d10e275db (patch) | |
tree | e93fa947f5bfb8f06a942da259ed882befbaec71 /filedistribution | |
parent | 530730213e9a8ee4e4b0d2d46b13a486d668bd23 (diff) |
Throw catch and exit on ZKOPERATIONTIMEDOUT
Diffstat (limited to 'filedistribution')
3 files changed, 8 insertions, 1 deletions
diff --git a/filedistribution/src/vespa/filedistribution/distributor/filedistributortrackerimpl.cpp b/filedistribution/src/vespa/filedistribution/distributor/filedistributortrackerimpl.cpp index 6420dfd6006..5112df7de09 100644 --- a/filedistribution/src/vespa/filedistribution/distributor/filedistributortrackerimpl.cpp +++ b/filedistribution/src/vespa/filedistribution/distributor/filedistributortrackerimpl.cpp @@ -1,5 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> + #include "filedistributortrackerimpl.h" #include <cmath> #include <libtorrent/tracker_manager.hpp> @@ -166,6 +166,9 @@ void asioWorker(asio::io_service& ioService) ioService.run(); } catch (const ZKConnectionLossException & e) { LOG(info, "Connection loss in asioWorker thread, resuming. %s", e.what()); + } catch (const ZKOperationTimeoutException & e) { + LOG(warning, "Operation timed out in asioWorker thread, will do quick exit to start a clean sheet. %s", e.what()); + std::quick_exit(31); } } } diff --git a/filedistribution/src/vespa/filedistribution/model/zkfacade.cpp b/filedistribution/src/vespa/filedistribution/model/zkfacade.cpp index 96d80218cff..be11f4d5519 100644 --- a/filedistribution/src/vespa/filedistribution/model/zkfacade.cpp +++ b/filedistribution/src/vespa/filedistribution/model/zkfacade.cpp @@ -132,6 +132,8 @@ public: throw fd::ZKNodeExistsException(path.string(), VESPA_STRLOC); case ZCONNECTIONLOSS: throw fd::ZKConnectionLossException(path.string(), VESPA_STRLOC); + case ZOPERATIONTIMEOUT: + throw fd::ZKOperationTimeoutException(path.string(), VESPA_STRLOC); default: if (_lastStatus != ZOK) { throw fd::ZKGenericException(_lastStatus, toErrorMsg(_lastStatus) + " : " + path.string(), VESPA_STRLOC); @@ -187,6 +189,7 @@ VESPA_IMPLEMENT_EXCEPTION(ZKConnectionLossException, ZKException); VESPA_IMPLEMENT_EXCEPTION(ZKNodeExistsException, ZKException); VESPA_IMPLEMENT_EXCEPTION(ZKFailedConnecting, ZKException); VESPA_IMPLEMENT_EXCEPTION(ZKSessionExpired, ZKException); +VESPA_IMPLEMENT_EXCEPTION(ZKOperationTimeoutException, ZKException); VESPA_IMPLEMENT_EXCEPTION_SPINE(ZKGenericException); } diff --git a/filedistribution/src/vespa/filedistribution/model/zkfacade.h b/filedistribution/src/vespa/filedistribution/model/zkfacade.h index bebc133590d..0e1236974a7 100644 --- a/filedistribution/src/vespa/filedistribution/model/zkfacade.h +++ b/filedistribution/src/vespa/filedistribution/model/zkfacade.h @@ -24,6 +24,7 @@ VESPA_DEFINE_EXCEPTION(ZKNodeDoesNotExistsException, ZKException); VESPA_DEFINE_EXCEPTION(ZKConnectionLossException, ZKException); VESPA_DEFINE_EXCEPTION(ZKNodeExistsException, ZKException); VESPA_DEFINE_EXCEPTION(ZKFailedConnecting, ZKException); +VESPA_DEFINE_EXCEPTION(ZKOperationTimeoutException, ZKException); VESPA_DEFINE_EXCEPTION(ZKSessionExpired, ZKException); class ZKGenericException : public ZKException { |