diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-02-25 07:53:11 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-02-25 07:53:11 +0000 |
commit | a13c8dbf74a65db3861947d143e894dba57195c3 (patch) | |
tree | b7cd7004cc8694fc5bba03741db60c0233428715 /config | |
parent | 94719c46c713f986a650910715e5847f5defa407 (diff) |
Move start and run into separate method to properly scope lifetime of objects and shutdown common transport last.
Diffstat (limited to 'config')
-rw-r--r-- | config/src/vespa/config/frt/frtconnection.cpp | 1 | ||||
-rw-r--r-- | config/src/vespa/config/frt/frtconnectionpool.cpp | 10 |
2 files changed, 10 insertions, 1 deletions
diff --git a/config/src/vespa/config/frt/frtconnection.cpp b/config/src/vespa/config/frt/frtconnection.cpp index 6eb71eb18f0..c7e21842851 100644 --- a/config/src/vespa/config/frt/frtconnection.cpp +++ b/config/src/vespa/config/frt/frtconnection.cpp @@ -28,6 +28,7 @@ FRTConnection::FRTConnection(const vespalib::string& address, FRT_Supervisor& su FRTConnection::~FRTConnection() { if (_target != nullptr) { + LOG(debug, "Shutting down %s", _address.c_str()); _target->SubRef(); _target = nullptr; } diff --git a/config/src/vespa/config/frt/frtconnectionpool.cpp b/config/src/vespa/config/frt/frtconnectionpool.cpp index f416b0e1a57..2ae812cd76e 100644 --- a/config/src/vespa/config/frt/frtconnectionpool.cpp +++ b/config/src/vespa/config/frt/frtconnectionpool.cpp @@ -7,6 +7,9 @@ #include <vespa/fnet/transport.h> #include <vespa/fastos/thread.h> +#include <vespa/log/log.h> +LOG_SETUP(".config.frt.frtconnectionpool"); + namespace config { FRTConnectionPool::FRTConnectionKey::FRTConnectionKey(int idx, const vespalib::string& hostname) @@ -39,7 +42,12 @@ FRTConnectionPool::FRTConnectionPool(FNET_Transport & transport, const ServerSpe setHostname(); } -FRTConnectionPool::~FRTConnectionPool() = default; +FRTConnectionPool::~FRTConnectionPool() { + LOG(debug, "Shutting down %lu connections", _connections.size()); + syncTransport(); + _connections.clear(); + syncTransport(); +} void FRTConnectionPool::syncTransport() |