summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-04-18 09:19:28 +0200
committerHenning Baldersheim <balder@oath.com>2018-04-18 09:19:28 +0200
commit6eddd5b238386be18c088084a8add9c4e009c110 (patch)
tree7bcbeeabb4881cb86067c22486cc63fd57cff8fb /storage
parent53ce1417da805a8d084414a7d4d3459e6fda2366 (diff)
Make rpc target cache ttl configurable with a deafult lifted from 30s to 10 minutes.
Diffstat (limited to 'storage')
-rw-r--r--storage/src/vespa/storage/config/stor-communicationmanager.def3
-rw-r--r--storage/src/vespa/storage/storageserver/communicationmanager.cpp5
2 files changed, 6 insertions, 2 deletions
diff --git a/storage/src/vespa/storage/config/stor-communicationmanager.def b/storage/src/vespa/storage/config/stor-communicationmanager.def
index 2c00dbe2f37..e29540de064 100644
--- a/storage/src/vespa/storage/config/stor-communicationmanager.def
+++ b/storage/src/vespa/storage/config/stor-communicationmanager.def
@@ -25,3 +25,6 @@ mbus.compress.level int default=3
## Compression type for packets.
mbus.compress.type enum {NONE, LZ4, ZSTD} default=LZ4
+
+## TTL for rpc target cache
+mbus.rpctargetcache.ttl double default = 600
diff --git a/storage/src/vespa/storage/storageserver/communicationmanager.cpp b/storage/src/vespa/storage/storageserver/communicationmanager.cpp
index 4a50c015526..22193d7e246 100644
--- a/storage/src/vespa/storage/storageserver/communicationmanager.cpp
+++ b/storage/src/vespa/storage/storageserver/communicationmanager.cpp
@@ -390,7 +390,7 @@ CommunicationManager::configureMessageBusLimits(const CommunicationManagerConfig
void CommunicationManager::configure(std::unique_ptr<CommunicationManagerConfig> config)
{
// Only allow dynamic (live) reconfiguration of message bus limits.
- if (_mbus.get()) {
+ if (_mbus) {
configureMessageBusLimits(*config);
if (_mbus->getRPCNetwork().getPort() != config->mbusport) {
auto m = make_string("mbus port changed from %d to %d. Will conduct a quick, but controlled restart.",
@@ -412,6 +412,7 @@ void CommunicationManager::configure(std::unique_ptr<CommunicationManagerConfig>
LOG(debug, "setting up slobrok config from id: '%s", _configUri.getConfigId().c_str());
params.setSlobrokConfig(_configUri);
+ params.setConnectionExpireSecs(config->mbus.rpctargetcache.ttl);
params.setIdentity(mbus::Identity(_component.getIdentity()));
if (config->mbusport != -1) {
@@ -438,7 +439,7 @@ void CommunicationManager::configure(std::unique_ptr<CommunicationManagerConfig>
_listener.reset(new FNetListener(*this, _configUri, config->rpcport));
- if (_mbus.get()) {
+ if (_mbus) {
mbus::DestinationSessionParams dstParams;
dstParams.setName("default");
dstParams.setBroadcastName(true);