core: Wrap keepalive runnables with exception logging

executor.schedule() will "eat" any exceptions thrown by the Runnables,
because the Future is expected to be used to see them. However, we never
call get() on the Future, so we need to just the exceptions like we do
elsewhere in this case.
This commit is contained in:
Eric Anderson 2017-03-30 13:46:33 -07:00
parent 0bcf921e20
commit d4c9d5f087
1 changed files with 4 additions and 4 deletions

View File

@ -55,7 +55,7 @@ public class KeepAliveManager {
private long nextKeepaliveTime;
private ScheduledFuture<?> shutdownFuture;
private ScheduledFuture<?> pingFuture;
private final Runnable shutdown = new Runnable() {
private final Runnable shutdown = new LogExceptionRunnable(new Runnable() {
@Override
public void run() {
boolean shouldShutdown = false;
@ -71,8 +71,8 @@ public class KeepAliveManager {
keepAlivePinger.onPingTimeout();
}
}
};
private final Runnable sendPing = new Runnable() {
});
private final Runnable sendPing = new LogExceptionRunnable(new Runnable() {
@Override
public void run() {
boolean shouldSendPing = false;
@ -95,7 +95,7 @@ public class KeepAliveManager {
keepAlivePinger.ping();
}
}
};
});
private long keepAliveDelayInNanos;
private long keepAliveTimeoutInNanos;