Skip to content

Commit

Permalink
Bug 36374879 - [36269700->23.09.3] CQC may miss concurrent updates du…
Browse files Browse the repository at this point in the history
…ring initial synchronization

RQ: job.9.20240306223756.18543

[git-p4: depot-paths = "//dev/coherence-ce/release/coherence-ce-v23.09/": change = 107291]
  • Loading branch information
mgamanho committed Mar 7, 2024
1 parent e3f5121 commit 86179f8
Showing 1 changed file with 26 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2023, Oracle and/or its affiliates.
* Copyright (c) 2000, 2024, 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 @@ -638,7 +638,7 @@ protected void changeState(int nState)
break;

case STATE_CONFIGURING:
synchronized (this)
synchronized (m_nState)
{
int nStatePrev = m_nState;
azzert(nStatePrev == STATE_DISCONNECTED ||
Expand All @@ -650,7 +650,7 @@ protected void changeState(int nState)
break;

case STATE_CONFIGURED:
synchronized (this)
synchronized (m_nState)
{
if (m_nState == STATE_CONFIGURING)
{
Expand All @@ -665,7 +665,7 @@ protected void changeState(int nState)
break;

case STATE_SYNCHRONIZED:
synchronized (this)
synchronized (m_nState)
{
if (m_nState == STATE_CONFIGURED)
{
Expand Down Expand Up @@ -1915,30 +1915,33 @@ protected boolean isEventDeferred(Object oKey)
Map mapSyncReq = m_mapSyncReq;
if (mapSyncReq != null)
{
if (getState() <= STATE_CONFIGURING)
synchronized (m_nState)
{
// handle a truncation event being received during configuration
// clear any currently pending events.
if (DeactivationListener.class.getName().equals(oKey))
if (getState() <= STATE_CONFIGURING)
{
mapSyncReq.clear();
// handle a truncation event being received during configuration
// clear any currently pending events.
if (DeactivationListener.class.getName().equals(oKey))
{
mapSyncReq.clear();
}
else
{
// since the listeners are being configured and the local
// cache is being populated, assume that the event is
// being processed out-of-order and requires a subsequent
// synchronization of the corresponding value
mapSyncReq.put(oKey, null);
}
fDeferred = true;
}
else
{
// since the listeners are being configured and the local
// cache is being populated, assume that the event is
// being processed out-of-order and requires a subsequent
// synchronization of the corresponding value
mapSyncReq.put(oKey, null);
// since an event has arrived after the configuration
// completed, the event automatically resolves the sync
// requirement
mapSyncReq.keySet().remove(oKey);
}
fDeferred = true;
}
else
{
// since an event has arrived after the configuration
// completed, the event automatically resolves the sync
// requirement
mapSyncReq.keySet().remove(oKey);
}
}
return fDeferred;
Expand Down Expand Up @@ -3077,7 +3080,7 @@ protected static String getDefaultName(String sCacheName, Filter filter, ValueEx
/**
* State of the {@code ContinuousQueryCache}. One of the {@code STATE_*} enums.
*/
protected volatile int m_nState;
protected volatile Integer m_nState;

/**
* While the {@code ContinuousQueryCache} is configuring or re-configuring its
Expand Down

0 comments on commit 86179f8

Please sign in to comment.