You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by km...@apache.org on 2016/12/23 21:10:11 UTC
[18/25] geode git commit: GEODE-2215: GatewaySenderAdvisor checks the
current processor to see if it has started
GEODE-2215: GatewaySenderAdvisor checks the current processor to see if it has started
* Previously it was checking the top level sender (possibly a concurrent sendor)
* This allowed a race condition where the top level sender was still starting up
* but the individual processors were ready to process. They would check the flag
* and because the sender was not ready, the processors would act and start initiating
* failover, which left the processor in a very weird state
Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/0b011171
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/0b011171
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/0b011171
Branch: refs/heads/feature/GEODE-2231
Commit: 0b0111710fc92406e46e495d6724dd46a25ef402
Parents: a9031bf
Author: Jason Huynh <hu...@gmail.com>
Authored: Fri Dec 9 15:28:23 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800
----------------------------------------------------------------------
.../apache/geode/internal/cache/wan/GatewaySenderAdvisor.java | 5 +++--
.../cache/wan/serial/SerialGatewaySenderEventProcessor.java | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/geode/blob/0b011171/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderAdvisor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderAdvisor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderAdvisor.java
index ace780e..baa9d9c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderAdvisor.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderAdvisor.java
@@ -475,7 +475,8 @@ public class GatewaySenderAdvisor extends DistributionAdvisor {
this.lockObtainingThread.start();
}
- public void waitToBecomePrimary() throws InterruptedException {
+ public void waitToBecomePrimary(AbstractGatewaySenderEventProcessor callingProcessor)
+ throws InterruptedException {
if (isPrimary()) {
return;
}
@@ -484,7 +485,7 @@ public class GatewaySenderAdvisor extends DistributionAdvisor {
LocalizedStrings.GatewayImpl_0__WAITING_TO_BECOME_PRIMARY_GATEWAY, this.sender.getId()));
while (!isPrimary()) {
this.primaryLock.wait(1000);
- if (sender.getEventProcessor() != null && sender.getEventProcessor().isStopped()) {
+ if (sender.getEventProcessor() != null && callingProcessor.isStopped()) {
logger.info("The event processor is stopped, not to wait for being primary any more.");
return;
}
http://git-wip-us.apache.org/repos/asf/geode/blob/0b011171/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderEventProcessor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderEventProcessor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderEventProcessor.java
index 9755adb..0aa0ed9 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderEventProcessor.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderEventProcessor.java
@@ -143,7 +143,7 @@ public class SerialGatewaySenderEventProcessor extends AbstractGatewaySenderEven
protected boolean waitForPrimary() {
try {
- this.sender.getSenderAdvisor().waitToBecomePrimary();
+ this.sender.getSenderAdvisor().waitToBecomePrimary(this);
} catch (InterruptedException e) {
// No need to set the interrupt bit, we're exiting the thread.
if (!stopped()) {