Proper logging when TimerTask fails
This commit is contained in:
parent
69b4817415
commit
546ac3260c
@ -32,6 +32,8 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import java.util.concurrent.locks.ReadWriteLock;
|
import java.util.concurrent.locks.ReadWriteLock;
|
||||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||||
|
|
||||||
|
import org.jboss.netty.logging.InternalLogger;
|
||||||
|
import org.jboss.netty.logging.InternalLoggerFactory;
|
||||||
import org.jboss.netty.util.ExecutorUtil;
|
import org.jboss.netty.util.ExecutorUtil;
|
||||||
import org.jboss.netty.util.MapBackedSet;
|
import org.jboss.netty.util.MapBackedSet;
|
||||||
|
|
||||||
@ -42,6 +44,9 @@ import org.jboss.netty.util.MapBackedSet;
|
|||||||
*/
|
*/
|
||||||
public class HashedWheelTimer implements Timer {
|
public class HashedWheelTimer implements Timer {
|
||||||
|
|
||||||
|
static final InternalLogger logger =
|
||||||
|
InternalLoggerFactory.getInstance(HashedWheelTimer.class);
|
||||||
|
|
||||||
private final Executor executor;
|
private final Executor executor;
|
||||||
private final Worker worker = new Worker();
|
private final Worker worker = new Worker();
|
||||||
|
|
||||||
@ -367,7 +372,9 @@ public class HashedWheelTimer implements Timer {
|
|||||||
try {
|
try {
|
||||||
task.run(this);
|
task.run(this);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
// FIXME log the exception
|
logger.warn(
|
||||||
|
"An exception was thrown by " +
|
||||||
|
TimerTask.class.getSimpleName() + ".", t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user