Skip to content

Commit

Permalink
- fixed problem with thread dump if no arguments are given
Browse files Browse the repository at this point in the history
- rejecting peers that are older than 6 hours (not-seen during 6 hours)
- 0.78, targeting 0.8 at the end of the week

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5948 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed May 11, 2009
1 parent a49edd9 commit c01d6f4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.properties
Expand Up @@ -3,7 +3,7 @@ javacSource=1.5
javacTarget=1.5

# Release Configuration
releaseVersion=0.77
releaseVersion=0.78
stdReleaseFile=yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
embReleaseFile=yacy_emb_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
proReleaseFile=yacy_pro_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
Expand Down
5 changes: 4 additions & 1 deletion htroot/Network.java
Expand Up @@ -381,7 +381,10 @@ record = recordIterator.next();
prop.putHTML(STR_TABLE_LIST + conCount + "_type_url", seed.get(yacySeed.SEEDLIST, "http://nowhere/"));

final long lastseen = Math.abs((System.currentTimeMillis() - seed.getLastSeenUTC()) / 1000 / 60);
if (page == 2 || lastseen > 1440) { // Passive Peers should be passive, also Peers without contact greater than an day
if (page == 1 && lastseen > 720) {
continue;
}
if (page == 2 || (page == 1 && lastseen > 360)) { // Passive Peers should be passive, also Peers without contact greater than 6 hours
// principal/senior/junior: red/red=offline
prop.put(STR_TABLE_LIST + conCount + "_type_direct", 2);
} else {
Expand Down
4 changes: 2 additions & 2 deletions htroot/Threaddump_p.java
Expand Up @@ -56,8 +56,8 @@ public static serverObjects respond(final httpRequestHeader header, final server

final StringBuilder buffer = new StringBuilder(1000);

final boolean plain = post.get("plain", "false").equals("true");
final int sleep = post.getInt("sleep", 0); // a sleep before creation of a thread dump can be used for profiling
final boolean plain = post != null && post.get("plain", "false").equals("true");
final int sleep = (post == null) ? 0 : post.getInt("sleep", 0); // a sleep before creation of a thread dump can be used for profiling
if (sleep > 0) try {Thread.sleep(sleep);} catch (final InterruptedException e) {}
prop.put("dump", "1");
// Thread dump
Expand Down
2 changes: 1 addition & 1 deletion htroot/env/templates/submenuViewLog.template
Expand Up @@ -3,6 +3,6 @@
<ul class="SubMenu">
<li><a href="/ViewLog_p.html" class="MenuItemLink lock">Server Log</a></li>
<li><a href="/LogStatistics_p.html" class="MenuItemLink lock">Log Statistics</a></li>
<li><a href="/Threaddump_p.html?createThreaddump=" class="MenuItemLink lock">Thread Dump</a></li>
<li><a href="/Threaddump_p.html" class="MenuItemLink lock">Thread Dump</a></li>
</ul>
</div>
2 changes: 1 addition & 1 deletion source/de/anomic/yacy/yacyPeerActions.java
Expand Up @@ -105,7 +105,7 @@ public synchronized boolean connectPeer(final yacySeed seed, final boolean direc
ctimeUTC0 = nowUTC0Time;
assert (seed.getLastSeenUTC() - ctimeUTC0 < 100);
}
if (Math.abs(nowUTC0Time - ctimeUTC0) > 60 * 60 * 12 * 1000) {
if (Math.abs(nowUTC0Time - ctimeUTC0) / 1000 / 60 > 60 * 6 ) {
// the new connection is out-of-age, we reject the connection
if (yacyCore.log.isFine()) yacyCore.log.logFine("connect: rejecting out-dated peer '" + seed.getName() + "' from " + seed.getPublicAddress() + "; nowUTC0=" + nowUTC0Time + ", seedUTC0=" + ctimeUTC0 + ", TimeDiff=" + DateFormatter.formatInterval(Math.abs(nowUTC0Time - ctimeUTC0)));
return false;
Expand Down

0 comments on commit c01d6f4

Please sign in to comment.