diff options
Diffstat (limited to 'messagebus')
3 files changed, 10 insertions, 4 deletions
diff --git a/messagebus/src/main/java/com/yahoo/messagebus/ProtocolRepository.java b/messagebus/src/main/java/com/yahoo/messagebus/ProtocolRepository.java index ad26475bf74..102e0be923d 100755 --- a/messagebus/src/main/java/com/yahoo/messagebus/ProtocolRepository.java +++ b/messagebus/src/main/java/com/yahoo/messagebus/ProtocolRepository.java @@ -28,7 +28,7 @@ public class ProtocolRepository { */ public void putProtocol(Protocol protocol) { if (protocols.put(protocol.getName(), protocol) != null) { - routingPolicyCache.clear(); + clearPolicyCache(); } } @@ -72,6 +72,10 @@ public class ProtocolRepository { return ret; } synchronized (this) { + ret = routingPolicyCache.get(cacheKey); + if (ret != null) { + return ret; + } Protocol protocol = getProtocol(protocolName); if (protocol == null) { log.log(LogLevel.ERROR, "Protocol '" + protocolName + "' not supported."); @@ -81,6 +85,9 @@ public class ProtocolRepository { ret = protocol.createPolicy(policyName, policyParam); } catch (RuntimeException e) { log.log(LogLevel.ERROR, "Protcol '" + protocolName + "' threw an exception: " + e.getMessage(), e); + if (ret != null) { + ret.destroy(); + } return null; } if (ret == null) { diff --git a/messagebus/src/main/java/com/yahoo/messagebus/network/rpc/RPCNetwork.java b/messagebus/src/main/java/com/yahoo/messagebus/network/rpc/RPCNetwork.java index 6b206435fa7..4a263aaae4c 100644 --- a/messagebus/src/main/java/com/yahoo/messagebus/network/rpc/RPCNetwork.java +++ b/messagebus/src/main/java/com/yahoo/messagebus/network/rpc/RPCNetwork.java @@ -37,7 +37,6 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.TreeMap; -import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.SynchronousQueue; import java.util.concurrent.ThreadPoolExecutor; @@ -83,7 +82,7 @@ public class RPCNetwork implements Network, MethodHandler { public RPCNetwork(RPCNetworkParams params, SlobrokConfigSubscriber slobrokConfig) { this.slobroksConfig = slobrokConfig; identity = params.getIdentity(); - orb = new Supervisor(new Transport()); + orb = new Supervisor(new Transport(2)); orb.setMaxInputBufferSize(params.getMaxInputBufferSize()); orb.setMaxOutputBufferSize(params.getMaxOutputBufferSize()); targetPool = new RPCTargetPool(params.getConnectionExpireSecs()); diff --git a/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp b/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp index e214a435a4e..04d1f634f09 100644 --- a/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp +++ b/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp @@ -405,7 +405,7 @@ RPCNetwork::sync() void RPCNetwork::shutdown() { - _transport->ShutDown(true); + _transport->ShutDown(false); _threadPool->Close(); _executor->shutdown(); _executor->sync(); |