This is an automated email from the ASF dual-hosted git repository.
eshu11 pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push:
new 81ca457 Revert "GEODE-6477: Reply with exception if exception
occurred during processing the message. (#3258)" Do not change the existing
product behavior as other places send the message as well. Instead I will open
a new ticket to handle the issue seen during gii.
81ca457 is described below
commit 81ca45754bb5c303d305c3fe8fb04a4d4f4e12bd
Author: eshu <[email protected]>
AuthorDate: Thu Mar 7 10:24:09 2019 -0800
Revert "GEODE-6477: Reply with exception if exception occurred during
processing the message. (#3258)"
Do not change the existing product behavior as other places send the
message as well.
Instead I will open a new ticket to handle the issue seen during gii.
This reverts commit a441757759819afa1fcfc3a36e10d4f22e762abe.
---
.../PrepareNewPersistentMemberMessage.java | 8 +--
.../PrepareNewPersistentMemberMessageTest.java | 62 ----------------------
2 files changed, 1 insertion(+), 69 deletions(-)
diff --git
a/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/PrepareNewPersistentMemberMessage.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/PrepareNewPersistentMemberMessage.java
index 82e6719..2325cd0 100644
---
a/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/PrepareNewPersistentMemberMessage.java
+++
b/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/PrepareNewPersistentMemberMessage.java
@@ -105,10 +105,8 @@ public class PrepareNewPersistentMemberMessage extends
HighPriorityDistributionM
} catch (RegionDestroyedException e) {
logger.debug("<RegionDestroyed> {}", this);
- exception = new ReplyException(e);
} catch (CancelException e) {
logger.debug("<CancelException> {}", this);
- exception = new ReplyException(e);
} catch (VirtualMachineError e) {
SystemFailure.initiateFailure(e);
throw e;
@@ -117,7 +115,7 @@ public class PrepareNewPersistentMemberMessage extends
HighPriorityDistributionM
exception = new ReplyException(t);
} finally {
LocalRegion.setThreadInitLevelRequirement(oldLevel);
- ReplyMessage replyMsg = createReplyMessage();
+ ReplyMessage replyMsg = new ReplyMessage();
replyMsg.setRecipient(getSender());
replyMsg.setProcessorId(processorId);
if (exception != null) {
@@ -127,10 +125,6 @@ public class PrepareNewPersistentMemberMessage extends
HighPriorityDistributionM
}
}
- ReplyMessage createReplyMessage() {
- return new ReplyMessage();
- }
-
@Override
public int getDSFID() {
return PREPARE_NEW_PERSISTENT_MEMBER_REQUEST;
diff --git
a/geode-core/src/test/java/org/apache/geode/internal/cache/persistence/PrepareNewPersistentMemberMessageTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/persistence/PrepareNewPersistentMemberMessageTest.java
deleted file mode 100644
index 78377d3..0000000
---
a/geode-core/src/test/java/org/apache/geode/internal/cache/persistence/PrepareNewPersistentMemberMessageTest.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license
- * agreements. See the NOTICE file distributed with this work for additional
information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache
License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express
- * or implied. See the License for the specific language governing permissions
and limitations under
- * the License.
- */
-package org.apache.geode.internal.cache.persistence;
-
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-import org.junit.Test;
-
-import org.apache.geode.cache.CacheClosedException;
-import org.apache.geode.cache.RegionDestroyedException;
-import org.apache.geode.distributed.internal.ClusterDistributionManager;
-import org.apache.geode.distributed.internal.ReplyMessage;
-import org.apache.geode.internal.cache.InternalCache;
-
-public class PrepareNewPersistentMemberMessageTest {
- private final ClusterDistributionManager manager =
mock(ClusterDistributionManager.class);
- private final ReplyMessage replyMessage = mock(ReplyMessage.class);
- private final InternalCache cache = mock(InternalCache.class);
- private final String regionPath = "regionPath";
-
- @Test
- public void
processMessageSendReplyWithExceptionIfFailedWithCancelledException() {
- PrepareNewPersistentMemberMessage message = spy(new
PrepareNewPersistentMemberMessage());
- when(manager.getExistingCache()).thenThrow(new CacheClosedException());
- doReturn(replyMessage).when(message).createReplyMessage();
-
- message.process(manager);
-
- verify(replyMessage).setException(any());
- }
-
- @Test
- public void
processMessageSendReplyWithExceptionIfFailedWithRegionDestroyedException() {
- PrepareNewPersistentMemberMessage message =
- spy(new PrepareNewPersistentMemberMessage(regionPath, null, null, 1));
- when(manager.getExistingCache()).thenReturn(cache);
- when(cache.getRegion(regionPath)).thenThrow(new
RegionDestroyedException("", ""));
- doReturn(replyMessage).when(message).createReplyMessage();
-
- message.process(manager);
-
- verify(replyMessage).setException(any());
- }
-
-}