Improve timeout message 14/58314/4
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 6 Jun 2017 09:19:07 +0000 (11:19 +0200)
committerTom Pantelis <tompantelis@gmail.com>
Tue, 13 Jun 2017 16:31:46 +0000 (16:31 +0000)
Rather than reporing nanoseconds, convert them to fraction seconds.

Change-Id: I9052462990f8c6b99349ed123f682ce3f0e23461
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/cds-access-client/src/main/java/org/opendaylight/controller/cluster/access/client/AbstractClientConnection.java

index abd668010a16ad09c3c0d573c0a0320cd59a9e85..380fdeb862bdb8fbb64b79cae0594803dd7fde7c 100644 (file)
@@ -367,8 +367,10 @@ public abstract class AbstractClientConnection<T extends BackendInfo> {
             tasksTimedOut++;
             queue.remove(now);
             LOG.debug("{}: Connection {} timed out entry {}", context.persistenceId(), this, head);
+
+            final double time = (beenOpen * 1.0) / 1_000_000_000;
             head.complete(head.getRequest().toRequestFailure(
-                new RequestTimeoutException("Timed out after " + beenOpen + "ns")));
+                new RequestTimeoutException("Timed out after " + time + "seconds")));
         }
 
         LOG.debug("Connection {} timed out {} tasks", this, tasksTimedOut);