Skip to content

Commit

Permalink
More logging
Browse files Browse the repository at this point in the history
Added log when server is bound to channel

Added log when ReconnectedChannel fails to connect.
  • Loading branch information
RagnarW committed Apr 11, 2018
1 parent d614915 commit ccebea4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -23,7 +23,6 @@
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.EventLoop;
import io.netty.util.Attribute;
import io.netty.util.AttributeKey;
import io.netty.util.concurrent.Promise;

Expand Down Expand Up @@ -95,7 +94,9 @@ else if ( fChannel != null && !fChannel.isDone() )
{
if ( !f.isSuccess() )
{
f.channel().eventLoop().schedule( this::tryConnect, connectionBackoff.getMillis(), MILLISECONDS );
long millis = connectionBackoff.getMillis();
log.warn( "Failed to connect to: %s. Retrying in %d ms", destination.socketAddress(), millis );
f.channel().eventLoop().schedule( this::tryConnect, millis, MILLISECONDS );
connectionBackoff.increment();
}
else
Expand Down
Expand Up @@ -99,6 +99,7 @@ public synchronized void start()
try
{
channel = bootstrap.bind().syncUninterruptibly().channel();
debugLog.info( serverName + ": bound to " + listenAddress );
}
catch ( Exception e )
{
Expand Down

0 comments on commit ccebea4

Please sign in to comment.