Skip to content

Commit

Permalink
Fix bug in refresh - refreshing was always on self id instead of if p…
Browse files Browse the repository at this point in the history
…assed from needRefresh method
  • Loading branch information
a-pavlov committed Jan 7, 2017
1 parent 3824c8b commit 2224eb6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/org/dkf/jed2k/kad/NodeImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void searchNotes(final KadId id) {
public void refresh(final KadId id) throws JED2KException {
assert id != null;
log.debug("[node] refresh on target {}", id);
Traversal t = new Refresh(this, self);
Traversal t = new Refresh(this, id);
t.start();
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/dkf/jed2k/kad/RoutingTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public int compare(RoutingTableBucket lhs, RoutingTableBucket rhs) {
}

if (now - lastRefresh < Time.seconds(45)) {
log.debug("[table] bucket {} has last refresh too recently {}", i, now - lastRefresh);
log.trace("[table] bucket {} has last refresh too recently {}", i, now - lastRefresh);
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public int compare(NodeEntry o1, NodeEntry o2) {

assert sorted;

log.debug("[find data] initial size {}", results.size());
log.debug("[find data] for {} initial size {}", getTarget(), results.size());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public String getName() {
@Override
public void done() {
// just remove algorithm from node
log.debug("[refresh] done");
log.debug("[refresh] {} done", getTarget());
nodeImpl.removeTraversalAlgorithm(this);
}
}
10 changes: 6 additions & 4 deletions core/src/main/resources/logging.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
handlers=java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level=FINEST
.level=FINE
.level=INFO
org.dkf.jed2k.kad.DhtTracker.level=INFO
org.dkf.jed2k.kad.NodeImpl.level=FINE
org.dkf.jed2k.kad.RoutingTable.level=INFO
org.dkf.jed2k.kad.RpcManager.level=FINE
org.dkf.jed2k.kad.traversal.algorithm.Traversal.level=FINE
org.dkf.jed2k.kad.RoutingTable.level=FINE
org.dkf.jed2k.kad.RpcManager.level=INFO
org.dkf.jed2k.kad.traversal.algorithm.Traversal.level=INFO
org.dkf.jed2k.kad.traversal.algorithm.Refresh.level=FINE
org.dkf.jed2k.kad.traversal.observer.Observer.level=FINE
#-Djava.util.logging.config.file=C:\dev\jed2k\core\src\main\resources\logging.properties

0 comments on commit 2224eb6

Please sign in to comment.