From 84467d5ec8c0d5a6dc4d712bc80621dc5ca36e8d Mon Sep 17 00:00:00 2001 From: Michal Polkorab Date: Thu, 23 Oct 2014 16:56:10 +0200 Subject: [PATCH] Fixed cache logging - successful rpc is no more logged as discarded - rpc is discarded only when it exceeds specified timeout Change-Id: I60b334958e76a428c7fa1eebe9a4910c90ef5a8d Signed-off-by: Michal Polkorab --- .../protocol/impl/connection/ConnectionAdapterImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/connection/ConnectionAdapterImpl.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/connection/ConnectionAdapterImpl.java index 62339ae8..c24899fd 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/connection/ConnectionAdapterImpl.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/connection/ConnectionAdapterImpl.java @@ -71,6 +71,7 @@ import org.slf4j.LoggerFactory; import com.google.common.base.Preconditions; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; +import com.google.common.cache.RemovalCause; import com.google.common.cache.RemovalListener; import com.google.common.cache.RemovalNotification; import com.google.common.util.concurrent.ListenableFuture; @@ -103,7 +104,9 @@ public class ConnectionAdapterImpl implements ConnectionFacade { @Override public void onRemoval( final RemovalNotification> notification) { - notification.getValue().discard(); + if (! notification.getCause().equals(RemovalCause.EXPLICIT)) { + notification.getValue().discard(); + } } }; -- 2.36.6