This commit is contained in:
jrandom
2004-07-01 22:33:51 +00:00
committed by zzz
parent 148dcc084d
commit 8a7e787f42
4 changed files with 30 additions and 18 deletions

View File

@ -157,6 +157,7 @@ public class OutNetMessage {
} catch (IOException ioe) { } catch (IOException ioe) {
_log.error("Error serializing the I2NPMessage for the OutNetMessage", ioe); _log.error("Error serializing the I2NPMessage for the OutNetMessage", ioe);
} }
return null; return null;
} }
} }
@ -237,14 +238,16 @@ public class OutNetMessage {
public void finalize() throws Throwable { public void finalize() throws Throwable {
if (_message != null) { if (_message != null) {
StringBuffer buf = new StringBuffer(1024); if (_log.shouldLog(Log.WARN)) {
buf.append("Undiscarded ").append(_messageSize).append("byte "); StringBuffer buf = new StringBuffer(1024);
buf.append(_messageType).append(" message created "); buf.append("Undiscarded ").append(_messageSize).append("byte ");
buf.append((_context.clock().now() - _created)).append("ms ago: "); buf.append(_messageType).append(" message created ");
buf.append(_messageId); // .append(" to ").append(_target.calculateHash().toBase64()); buf.append((_context.clock().now() - _created)).append("ms ago: ");
buf.append(", timing - \n"); buf.append(_messageId); // .append(" to ").append(_target.calculateHash().toBase64());
renderTimestamps(buf); buf.append(", timing - \n");
_log.error(buf.toString(), _createdBy); renderTimestamps(buf);
_log.warn(buf.toString(), _createdBy);
}
_context.messageStateMonitor().outboundMessageDiscarded(); _context.messageStateMonitor().outboundMessageDiscarded();
} }
_context.messageStateMonitor().outboundMessageFinalized(); _context.messageStateMonitor().outboundMessageFinalized();

View File

@ -70,6 +70,7 @@ public class OutboundMessageRegistry {
long continueTime = 0; long continueTime = 0;
int numMessages = messages.size(); int numMessages = messages.size();
StringBuffer slow = new StringBuffer(256);
long afterSync1 = _context.clock().now(); long afterSync1 = _context.clock().now();
ArrayList matchedRemove = null; // new ArrayList(32); ArrayList matchedRemove = null; // new ArrayList(32);
@ -86,6 +87,8 @@ public class OutboundMessageRegistry {
if (_log.shouldLog(Log.WARN)) if (_log.shouldLog(Log.WARN))
_log.warn("Matching with selector took too long (" + diff + "ms) : " _log.warn("Matching with selector took too long (" + diff + "ms) : "
+ selector.getClass().getName()); + selector.getClass().getName());
slow.append(selector.getClass().getName()).append(": ");
slow.append(diff).append(" ");
} }
matchTime += diff; matchTime += diff;
@ -134,11 +137,17 @@ public class OutboundMessageRegistry {
if (delay > 1000) if (delay > 1000)
level = Log.ERROR; level = Log.ERROR;
if (_log.shouldLog(level)) { if (_log.shouldLog(level)) {
_log.log(level, "getMessages took " + delay + "ms with search time of " StringBuffer buf = new StringBuffer(1024);
+ search + "ms (match: " + matchTime + "ms, continue: " buf.append("getMessages took ").append(delay).append("ms with search time of");
+ continueTime + "ms, #: " + numMessages + ") and sync time of " buf.append(search).append("ms (match: ").append(matchTime).append("ms, continue: ");
+ sync + "ms for " + (matchedRemove == null ? 0 : matchedRemove.size()) buf.append(continueTime).append("ms, #: ").append(numMessages).append(") and sync time of ");
+ " removed, " + matches.size() + " matches"); buf.append(sync).append("ms for ");
if (matchedRemove == null)
buf.append(0);
else
buf.append(matchedRemove.size());
buf.append(" removed, ").append(matches.size()).append(" matches: slow = ").append(slow.toString());
_log.log(level, buf.toString());
} }
return matches; return matches;

View File

@ -166,8 +166,8 @@ class TCPListener {
_log.debug("Handle successful"); _log.debug("Handle successful");
} else { } else {
if (h.receivedIdentByte()) { if (h.receivedIdentByte()) {
if (_log.shouldLog(Log.ERROR)) if (_log.shouldLog(Log.WARN))
_log.error("Unable to handle in the time allotted"); _log.warn("Unable to handle in the time allotted");
} else { } else {
if (_log.shouldLog(Log.DEBUG)) if (_log.shouldLog(Log.DEBUG))
_log.debug("Peer didn't send the ident byte, so either they were testing us, or portscanning"); _log.debug("Peer didn't send the ident byte, so either they were testing us, or portscanning");

View File

@ -820,12 +820,12 @@ public class RequestTunnelJob extends JobImpl {
public String getName() { return "Create Tunnel Failed"; } public String getName() { return "Create Tunnel Failed"; }
public void runJob() { public void runJob() {
// update the tunnel so its known to be not working // update the tunnel so its known to be not working
if (_log.shouldLog(Log.ERROR)) { if (_log.shouldLog(Log.WARN)) {
_log.error("Tunnel creation timed out for tunnel " + _tunnel.getTunnelId() + " at router " _log.warn("Tunnel creation timed out for tunnel " + _tunnel.getTunnelId() + " at router "
+ _tunnel.getThisHop().toBase64() + " from router " + _tunnel.getThisHop().toBase64() + " from router "
+ _context.routerHash().toBase64() + " after waiting " + _context.routerHash().toBase64() + " after waiting "
+ (_context.clock().now()-_started) + "ms"); + (_context.clock().now()-_started) + "ms");
_log.error("Added by", Failure.this.getAddedBy()); _log.warn("Added by", Failure.this.getAddedBy());
} }
synchronized (_failedTunnelParticipants) { synchronized (_failedTunnelParticipants) {
_failedTunnelParticipants.add(_tunnel.getThisHop()); _failedTunnelParticipants.add(_tunnel.getThisHop());