Improve timeout message
[controller.git] / opendaylight / md-sal / cds-access-client / src / main / java / org / opendaylight / controller / cluster / access / client / AbstractClientConnection.java
index 98442256c6ecbcc9f63f54586d05611a80797d36..380fdeb862bdb8fbb64b79cae0594803dd7fde7c 100644 (file)
@@ -217,7 +217,7 @@ public abstract class AbstractClientConnection<T extends BackendInfo> {
             if (delay >= DEBUG_DELAY_NANOS) {
                 if (delay > MAX_DELAY_NANOS) {
                     LOG.info("Capping {} throttle delay from {} to {} seconds", this,
-                        TimeUnit.NANOSECONDS.toSeconds(delay), MAX_DELAY_SECONDS);
+                        TimeUnit.NANOSECONDS.toSeconds(delay), MAX_DELAY_SECONDS, new Throwable());
                     delay = MAX_DELAY_NANOS;
                 }
                 if (LOG.isDebugEnabled()) {
@@ -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);