Skip to content

Commit

Permalink
GEODE-3841 CI Failure : WanCommandListDUnitTest.testListGatewaySender…
Browse files Browse the repository at this point in the history
…GatewayReceiver_group

GEODE-3780 suspected member is never watched again after passing final check

Added FinalCheckPassedMessage to the DSFID registry and added a test
to ensure that it's possible to serialize and deserialize one of these
objects.
  • Loading branch information
bschuchardt committed Oct 18, 2017
1 parent 8fdacaf commit 2636bd8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public class FinalCheckPassedMessage extends HighPriorityDistributionMessage {

private InternalDistributedMember suspect;

public FinalCheckPassedMessage() {}

public FinalCheckPassedMessage(InternalDistributedMember recipient,
InternalDistributedMember suspect) {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
import org.apache.geode.distributed.internal.membership.gms.locator.FindCoordinatorResponse;
import org.apache.geode.distributed.internal.membership.gms.locator.GetViewRequest;
import org.apache.geode.distributed.internal.membership.gms.locator.GetViewResponse;
import org.apache.geode.distributed.internal.membership.gms.messages.FinalCheckPassedMessage;
import org.apache.geode.distributed.internal.membership.gms.messages.HeartbeatMessage;
import org.apache.geode.distributed.internal.membership.gms.messages.HeartbeatRequestMessage;
import org.apache.geode.distributed.internal.membership.gms.messages.InstallViewMessage;
Expand Down Expand Up @@ -475,6 +476,7 @@ public static void registerTypes() {
}

private static void registerDSFIDTypes() {
registerDSFID(FINAL_CHECK_PASSED_MESSAGE, FinalCheckPassedMessage.class);
registerDSFID(NETWORK_PARTITION_MESSAGE, NetworkPartitionMessage.class);
registerDSFID(REMOVE_MEMBER_REQUEST, RemoveMemberMessage.class);
registerDSFID(HEARTBEAT_REQUEST, HeartbeatRequestMessage.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
package org.apache.geode.distributed.internal.membership.gms.fd;

import org.apache.geode.DataSerializer;
import org.apache.geode.distributed.internal.*;
import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
import org.apache.geode.distributed.internal.membership.NetView;
Expand All @@ -30,6 +31,7 @@
import org.apache.geode.distributed.internal.membership.gms.messages.HeartbeatRequestMessage;
import org.apache.geode.distributed.internal.membership.gms.messages.SuspectMembersMessage;
import org.apache.geode.distributed.internal.membership.gms.messages.SuspectRequest;
import org.apache.geode.internal.HeapDataOutputStream;
import org.apache.geode.internal.net.SocketCreator;
import org.apache.geode.internal.Version;
import org.apache.geode.internal.net.SocketCreatorFactory;
Expand Down Expand Up @@ -529,6 +531,21 @@ public void testExonerationMessageIsSentAfterSuccessfulFinalCheck() {
}
}

@Test
public void testFinalCheckPassedMessageCanBeSerializedAndDeserialized()
throws IOException, ClassNotFoundException {
HeapDataOutputStream heapDataOutputStream = new HeapDataOutputStream(500, Version.CURRENT);
FinalCheckPassedMessage message =
new FinalCheckPassedMessage(mockMembers.get(0), mockMembers.get(1));
DataSerializer.writeObject(message, heapDataOutputStream);
ByteArrayInputStream byteArrayInputStream =
new ByteArrayInputStream(heapDataOutputStream.toByteArray());
DataInputStream dataInputStream = new DataInputStream(byteArrayInputStream);
message = DataSerializer.readObject(dataInputStream);
assertEquals(mockMembers.get(1), message.getSuspect());
}



@Test
public void testInitiatorRewatchesSuspectAfterSuccessfulFinalCheck() {
Expand Down

0 comments on commit 2636bd8

Please sign in to comment.