Commit 07081f4a authored by Guus der Kinderen's avatar Guus der Kinderen Committed by akrherz

Changed logging in OutgoingSessionPromise.

parent 2923b46d
...@@ -195,7 +195,9 @@ public class OutgoingSessionPromise implements RoutableChannelHandler { ...@@ -195,7 +195,9 @@ public class OutgoingSessionPromise implements RoutableChannelHandler {
} }
} }
private class PacketsProcessor implements Runnable { private class PacketsProcessor implements Runnable
{
private final Logger Log = LoggerFactory.getLogger( PacketsProcessor.class );
private OutgoingSessionPromise promise; private OutgoingSessionPromise promise;
private String domain; private String domain;
...@@ -226,9 +228,7 @@ public class OutgoingSessionPromise implements RoutableChannelHandler { ...@@ -226,9 +228,7 @@ public class OutgoingSessionPromise implements RoutableChannelHandler {
// Check if enough time has passed to attempt a new s2s // Check if enough time has passed to attempt a new s2s
if (System.currentTimeMillis() - failureTimestamp < 5000) { if (System.currentTimeMillis() - failureTimestamp < 5000) {
returnErrorToSender(packet); returnErrorToSender(packet);
Log.debug( Log.debug( "Error sending packet to domain '{}' (fast discard): {}", domain, packet );
"OutgoingSessionPromise: Error sending packet to remote server (fast discard): " +
packet);
continue; continue;
} }
else { else {
...@@ -241,9 +241,7 @@ public class OutgoingSessionPromise implements RoutableChannelHandler { ...@@ -241,9 +241,7 @@ public class OutgoingSessionPromise implements RoutableChannelHandler {
} }
catch (Exception e) { catch (Exception e) {
returnErrorToSender(packet); returnErrorToSender(packet);
Log.debug( Log.debug( "Error sending packet to domain '{}': {}", domain, packet, e );
"OutgoingSessionPromise: Error sending packet to remote server: " + packet,
e);
// Mark the time when s2s failed // Mark the time when s2s failed
failureTimestamp = System.currentTimeMillis(); failureTimestamp = System.currentTimeMillis();
} }
...@@ -331,16 +329,16 @@ public class OutgoingSessionPromise implements RoutableChannelHandler { ...@@ -331,16 +329,16 @@ public class OutgoingSessionPromise implements RoutableChannelHandler {
} }
} }
catch (Exception e) { catch (Exception e) {
Log.warn("Error returning error to sender. Original packet: " + packet, e); Log.warn( "An exception occurred while trying to returning a remote-server-not-found error (for domain '{}') to the original sender. Original packet: {}", domain, packet, e );
} }
} }
public void addPacket(Packet packet) void addPacket( Packet packet )
{ {
if ( !packetQueue.offer( packet ) ) if ( !packetQueue.offer( packet ) )
{ {
returnErrorToSender(packet); returnErrorToSender(packet);
Log.debug( "OutgoingSessionPromise: Error sending packet to remote server (queue full): " + packet); Log.debug( "Error sending packet to domain '{}' (outbound queue full): {}", domain, packet );
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment