This is an automated email from the ASF dual-hosted git repository.
mmartell pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-native.git
The following commit(s) were added to refs/heads/develop by this push:
new 0550b0f Eliminate duplicate REGISTER_INTEREST message (#906)
0550b0f is described below
commit 0550b0ff4d4040500cc52baef9297c01691011a8
Author: Blake Bender <[email protected]>
AuthorDate: Tue Jan 18 07:13:05 2022 -0800
Eliminate duplicate REGISTER_INTEREST message (#906)
- first endpoint in m_redundantEndpoints was originally supposed to
be left out of the for loop. This broke during a refactor roughly three
years ago, moving from old-school iterator to a ranged for loop.
Co-authored-by: Blake Bender <[email protected]>
---
cppcache/src/ThinClientRedundancyManager.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/cppcache/src/ThinClientRedundancyManager.cpp
b/cppcache/src/ThinClientRedundancyManager.cpp
index ee00c55..4752c9b 100644
--- a/cppcache/src/ThinClientRedundancyManager.cpp
+++ b/cppcache/src/ThinClientRedundancyManager.cpp
@@ -887,7 +887,11 @@ GfErrType
ThinClientRedundancyManager::sendSyncRequestRegisterInterest(
TcrEndpoint* primaryEndpoint = nullptr;
if (!m_redundantEndpoints.empty()) {
- for (auto&& redundantEndpoint : m_redundantEndpoints) {
+ primaryEndpoint = m_redundantEndpoints[0];
+ for (auto& redundantEndpoint : m_redundantEndpoints) {
+ if (redundantEndpoint == primaryEndpoint) {
+ continue;
+ }
redundantEndpoint->setDM(request.getDM());
opErr = theHADM->sendSyncRequestRegisterInterestEP(
request, reply, false, redundantEndpoint);
@@ -895,7 +899,6 @@ GfErrType
ThinClientRedundancyManager::sendSyncRequestRegisterInterest(
err = opErr;
}
}
- primaryEndpoint = m_redundantEndpoints[0];
}
if ((request.getMessageType() == TcrMessage::REGISTER_INTEREST_LIST ||