Skip to content
Browse files

Reduce logging for old FNP.

  • Loading branch information...
1 parent ac70ab9 commit 5de1a35970eb5f85041e6e61b9a1e0c2a260c60e @toad toad committed Jan 12, 2011
Showing with 12 additions and 4 deletions.
  1. +12 −4 src/freenet/io/xfer/PacketThrottle.java
View
16 src/freenet/io/xfer/PacketThrottle.java
@@ -26,6 +26,7 @@
import freenet.io.comm.PeerContext;
import freenet.io.comm.PeerRestartedException;
import freenet.node.MessageItem;
+import freenet.node.PeerNode;
import freenet.node.SyncSendWaitedTooLongException;
import freenet.support.LogThresholdCallback;
import freenet.support.Logger;
@@ -271,7 +272,7 @@ public MessageItem sendThrottledMessage(Message msg, PeerContext peer, int packe
Logger.error(this, "Congestion control wait time: "+waitTime+" for "+this);
else if(logMINOR)
Logger.minor(this, "Congestion control wait time: "+waitTime+" for "+this);
- MyCallback callback = new MyCallback(cbForAsyncSend, packetSize, ctr);
+ MyCallback callback = new MyCallback(cbForAsyncSend, packetSize, ctr, peer != null && peer instanceof PeerNode && ((PeerNode)peer).isOldFNP());
MessageItem sent;
try {
sent = peer.sendAsync(msg, callback, ctr);
@@ -315,13 +316,15 @@ else if(logMINOR)
private boolean sent = false;
private final int packetSize;
private final ByteCounter ctr;
+ private final boolean isOldFNP;
private AsyncMessageCallback chainCallback;
- public MyCallback(AsyncMessageCallback cbForAsyncSend, int packetSize, ByteCounter ctr) {
+ public MyCallback(AsyncMessageCallback cbForAsyncSend, int packetSize, ByteCounter ctr, boolean isOldFNP) {
this.chainCallback = cbForAsyncSend;
this.packetSize = packetSize;
this.ctr = ctr;
+ this.isOldFNP = isOldFNP;
}
public void acknowledged() {
@@ -368,8 +371,13 @@ public void sent() {
public void sent(boolean error) {
synchronized(PacketThrottle.this) {
if(sent) return;
- if(error)
- Logger.error(this, "Acknowledged called but not sent, assuming it has been sent on "+this);
+ if(error) {
+ if(!isOldFNP)
+ Logger.error(this, "Acknowledged called but not sent, assuming it has been sent on "+this);
+ else
+ // This looks like an old-FNP bug. Log at a lower priority.
+ Logger.normal(this, "Acknowledged called but not sent, assuming it has been sent on "+this);
+ }
sent = true;
}
ctr.sentPayload(packetSize);

0 comments on commit 5de1a35

Please sign in to comment.
Something went wrong with that request. Please try again.