Skip to content

Commit

Permalink
Bug 37524889 - [37502800->24.09.3] java.io.EOFException: 'null', occu…
Browse files Browse the repository at this point in the history
…rred reading Message OwnershipResponse Type=42 for Service=PartitionedCache

[git-p4: depot-paths = "//dev/coherence-ce/release/coherence-ce-v24.09/": change = 113788]
  • Loading branch information
mgamanho committed Jan 27, 2025
1 parent 31d3878 commit 75c15a9
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/*
* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
* Copyright (c) 2000, 2025, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* https://oss.oracle.com/licenses/upl.
Expand Down Expand Up @@ -2638,7 +2638,7 @@ public boolean isVersionCompatible(com.tangosol.coherence.component.net.Member m
}

/**
* Check whether the specified members runs a version that precedes the
* Check whether the specified member runs a version that precedes the
* specified one.
*/
public boolean isVersionCompatible(com.tangosol.coherence.component.net.Member member, int nMajor, int nMinor, int nMicro, int nPatchSet, int nPatch)
Expand All @@ -2648,7 +2648,47 @@ public boolean isVersionCompatible(com.tangosol.coherence.component.net.Member m
return isVersionCompatible(member,
ServiceMemberSet.encodeVersion(nMajor, nMinor, nMicro, nPatchSet, nPatch));
}


/**
* Check whether the specified member runs a version that satisfies the
* predicate.
*/
public boolean isVersionCompatible(Member member, IntPredicate predicate)
{
return predicate.test(getClusterMemberSet().getServiceVersionInt(member.getId()));
}

/**
* Check whether the specified members run a version that satisfies the
* predicate.
*/
public boolean isVersionCompatible(MemberSet setMembers, IntPredicate predicate)
{
com.tangosol.coherence.component.net.memberSet.actualMemberSet.serviceMemberSet.MasterMemberSet setMaster = getClusterMemberSet();

switch (setMembers.size())
{
case 0: // no recipients
return true;

case 1: // common case
return predicate.test(setMaster.getServiceVersionInt(setMembers.getFirstId()));

default:
{
int[] anMember = setMembers.toIdArray();
for (int i = 0, c = anMember.length; i < c; i++)
{
if (!predicate.test(setMaster.getServiceVersionInt(anMember[i])))
{
return false;
}
}
return true;
}
}
}

/**
* Check whether any of the members in the specified MemberSet run a version
* that precedes the specified one.
Expand Down Expand Up @@ -6833,7 +6873,7 @@ public com.tangosol.coherence.component.util.ServiceConfig.Map getConfigMap()
*/
public String getDescription()
{
return "UpdateMap=" + getUpdateMap() + "; Remove=" + isRemove();
return "MapConfig=" + getConfigMap() + "\nUpdateMap=" + getUpdateMap() + "; Remove=" + isRemove();
}

// Accessor for the property "UpdateMap"
Expand Down Expand Up @@ -6905,11 +6945,11 @@ public void onReceived()
}

super.onReceived();

if (!service.isWelcomedBy(memberFrom))
{
// COH-5774: drop "early" updates. We must have received a MemberWelcome first.
_trace("Ignoring premature ConfigSync from member " + memberFrom.getId(), 5);
_trace("Ignoring premature ConfigUpdate from member " + memberFrom.getId(), 5);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19059,7 +19059,7 @@ public void read(com.tangosol.io.ReadBuffer.BufferInput input)
boolean fStores = input.readBoolean();
if (fStores)
{
boolean fStoresCompat = service.isVersionCompatible(OwnershipResponse::isLazyOpenCompatible);
boolean fStoresCompat = service.isVersionCompatible(getFromMember(), OwnershipResponse::isLazyOpenCompatible);
int cStores = input.readInt();
PersistentStoreInfo[] aInfo = new PersistentStoreInfo[cStores];
for (int i = 0; i < cStores; i++)
Expand Down Expand Up @@ -19163,7 +19163,7 @@ public void write(com.tangosol.io.WriteBuffer.BufferOutput output)
output.writeBoolean(fStores);
if (fStores)
{
boolean fStoresCompat = service.isVersionCompatible(OwnershipResponse::isLazyOpenCompatible);
boolean fStoresCompat = service.isVersionCompatible(getToMemberSet(), OwnershipResponse::isLazyOpenCompatible);
// write the persistent store ids
int cStores = aInfo.length;

Expand Down

0 comments on commit 75c15a9

Please sign in to comment.