From 09be0702f4ec9f189a0ea59d1923e80717b9fd8a Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Wed, 29 Apr 2015 21:36:46 +0200 Subject: [PATCH] Improved error reporting in case of ReadPendingException. --- .../main/java/org/eclipse/jetty/io/FillInterest.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/FillInterest.java b/jetty-io/src/main/java/org/eclipse/jetty/io/FillInterest.java index 480fcb39a0d..34f7385ee9f 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/FillInterest.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/FillInterest.java @@ -21,6 +21,8 @@ package org.eclipse.jetty.io; import java.io.IOException; import java.nio.channels.ClosedChannelException; import java.nio.channels.ReadPendingException; +import java.text.SimpleDateFormat; +import java.util.Date; import java.util.concurrent.atomic.AtomicReference; import org.eclipse.jetty.util.Callback; @@ -59,7 +61,7 @@ public abstract class FillInterest if (LOG.isDebugEnabled()) { LOG.debug("{} register {}",this,callback); - _lastSet=new Throwable(); + _lastSet=new Throwable(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date()) + ":" + Thread.currentThread().getName()); } } else @@ -102,11 +104,11 @@ public abstract class FillInterest { return _interested.get() != null; } - + /** * Call to signal a failure to a registered interest - * - * @param cause the cause of the failure + * + * @param cause the cause of the failure * @return true if the cause was passed to a {@link Callback} instance */ public boolean onFail(Throwable cause) @@ -132,7 +134,7 @@ public abstract class FillInterest { return String.format("FillInterest@%x{%b,%s}", hashCode(), _interested.get(), _interested.get()); } - + /** * Register the read interest * Abstract method to be implemented by the Specific ReadInterest to