You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ji...@apache.org on 2016/07/07 18:13:24 UTC
[3/7] incubator-geode git commit: GEODE-1613 CI failure:
ConnectionPoolDUnitTest.test021ClientGetOfInvalidServerEntry
GEODE-1613 CI failure: ConnectionPoolDUnitTest.test021ClientGetOfInvalidServerEntry
Added a try/catch for scheduling the task to handle RejectedExecutionException
& fixed up the handling of shutdown conditions so the run() method no longer
throws cancellation exceptions.
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/860c9020
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/860c9020
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/860c9020
Branch: refs/heads/feature/GEODE-1571
Commit: 860c902048d63cc7ae0fe3bf3c2cd329486fa73b
Parents: 7b28a8d
Author: Bruce Schuchardt <bs...@pivotal.io>
Authored: Thu Jul 7 10:25:49 2016 -0700
Committer: Bruce Schuchardt <bs...@pivotal.io>
Committed: Thu Jul 7 10:28:06 2016 -0700
----------------------------------------------------------------------
.../DataSerializerRecoveryListener.java | 33 ++++++++++++++------
1 file changed, 24 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/860c9020/geode-core/src/main/java/com/gemstone/gemfire/cache/client/internal/DataSerializerRecoveryListener.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/cache/client/internal/DataSerializerRecoveryListener.java b/geode-core/src/main/java/com/gemstone/gemfire/cache/client/internal/DataSerializerRecoveryListener.java
index 0c3f692..ef471c8 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/cache/client/internal/DataSerializerRecoveryListener.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/cache/client/internal/DataSerializerRecoveryListener.java
@@ -89,17 +89,20 @@ public class DataSerializerRecoveryListener extends EndpointManager.EndpointList
@Override
public void run2() {
- if(pool.getCancelCriterion().cancelInProgress() != null) {
+ if (pool.getCancelCriterion().cancelInProgress() != null) {
return;
}
+
synchronized(recoveryScheduledLock) {
recoveryScheduled = false;
}
+
logger.debug("DataSerializerRecoveryTask - Attempting to recover dataSerializers");
SerializerAttributesHolder[] holders= InternalDataSerializer.getSerializersForDistribution();
if(holders.length == 0) {
return;
}
+
EventID eventId = InternalDataSerializer.generateEventId();
//Fix for bug:40930
if (eventId == null) {
@@ -108,8 +111,9 @@ public class DataSerializerRecoveryListener extends EndpointManager.EndpointList
TimeUnit.MILLISECONDS);
recoveryScheduled = true;
} catch (RejectedExecutionException e) {
- pool.getCancelCriterion().checkCancelInProgress(e);
- throw e;
+ if (pool.getCancelCriterion().cancelInProgress() == null) {
+ throw e;
+ }
}
}
else {
@@ -117,15 +121,18 @@ public class DataSerializerRecoveryListener extends EndpointManager.EndpointList
RegisterDataSerializersOp.execute(pool, holders, eventId);
}
catch (CancelException e) {
- throw e;
+ return;
}
catch (RejectedExecutionException e) {
// This is probably because we've started to shut down.
- pool.getCancelCriterion().checkCancelInProgress(e);
- throw e; // weird
+ if (pool.getCancelCriterion().cancelInProgress() == null) {
+ throw e; // weird
+ }
}
catch(Exception e) {
- pool.getCancelCriterion().checkCancelInProgress(e);
+ if (pool.getCancelCriterion().cancelInProgress() != null) {
+ return;
+ }
// If ClassNotFoundException occurred on server, don't retry
Throwable cause = e.getCause();
@@ -141,8 +148,16 @@ public class DataSerializerRecoveryListener extends EndpointManager.EndpointList
logger.warn(LocalizedMessage.create(
LocalizedStrings.DataSerializerRecoveryListener_ERROR_RECOVERING_DATASERIALIZERS),
e);
- background.schedule(new RecoveryTask(), pingInterval, TimeUnit.MILLISECONDS);
- recoveryScheduled = true;
+ try {
+ background.schedule(new RecoveryTask(), pingInterval, TimeUnit.MILLISECONDS);
+ recoveryScheduled = true;
+ } catch (RejectedExecutionException ex) { // GEODE-1613 - suspect string while shutting down
+ if (!background.isTerminated()
+ && pool.getCancelCriterion().cancelInProgress() == null) {
+ throw ex;
+ }
+ }
+
}
} finally {
pool.releaseThreadLocalConnection();