Permalink
Browse files

* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54045.

Make sure getMembers() returns available member when TcpFailureDetector works in static cluster. 
Patch by kfujino

git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@1446758 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 72bfe0a commit 7ab918bae2d7af62c235d32e13207102a968b9ba @markt-asf markt-asf committed Feb 15, 2013
View
@@ -61,13 +61,6 @@ PATCHES PROPOSED TO BACKPORT:
+1: markt, kkolinko
-1:
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54045.
- Make sure getMembers() returns available member when TcpFailureDetector works
- in static cluster.
- http://svn.apache.org/viewvc?view=revision&revision=1402110
- +1: kfujino, kkolinko, markt
- -1:
-
* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54044
Correct bug in timestamp cache used by org.apache.juli.OneLineFormatter
that meant entries could be made with an earlier timestamp than the true timestamp.
@@ -35,6 +35,7 @@
import org.apache.catalina.tribes.io.XByteBuffer;
import org.apache.catalina.tribes.membership.MemberImpl;
import org.apache.catalina.tribes.membership.Membership;
+import org.apache.catalina.tribes.membership.StaticMember;
/**
* <p>Title: A perfect failure detector </p>
@@ -152,6 +153,9 @@ public void memberDisappeared(Member member) {
//not correct, we need to maintain the map
membership.removeMember( (MemberImpl) member);
removeSuspects.remove(member);
+ if (member instanceof StaticMember) {
+ addSuspects.put(member, Long.valueOf(System.currentTimeMillis()));
+ }
notify = true;
} else {
//add the member as suspect
@@ -218,7 +222,11 @@ protected void performForcedCheck() {
if (membership.getMember(members[i])!=null) {
membership.removeMember((MemberImpl)members[i]);
removeSuspects.remove(members[i]);
- super.memberDisappeared((MemberImpl)members[i]);
+ if (members[i] instanceof StaticMember) {
+ addSuspects.put(members[i],
+ Long.valueOf(System.currentTimeMillis()));
+ }
+ super.memberDisappeared(members[i]);
}
} //end if
} //for
@@ -229,6 +237,10 @@ protected void performBasicCheck() {
//update all alive times
Member[] members = super.getMembers();
for (int i = 0; members != null && i < members.length; i++) {
+ if (addSuspects.containsKey(members[i]) && membership.getMember(members[i]) == null) {
+ // avoid temporary adding member.
+ continue;
+ }
if (membership.memberAlive( (MemberImpl) members[i])) {
//we don't have this one in our membership, check to see if he/she is alive
if (memberAlive(members[i])) {
@@ -88,6 +88,14 @@
</fix>
</changelog>
</subsection>
+ <subsection name="Cluster">
+ <changelog>
+ <fix>
+ <bug>54045</bug>: Make sure getMembers() returns available member when
+ TcpFailureDetector works in static cluster. (kfujino)
+ </fix>
+ </changelog>
+ </subsection>
<subsection name="Web applications">
<changelog>
<fix>

0 comments on commit 7ab918b

Please sign in to comment.