DonalEvans commented on a change in pull request #5821:
URL: https://github.com/apache/geode/pull/5821#discussion_r539569203
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderEventProcessor.java
##########
@@ -638,6 +639,17 @@ protected boolean basicHandlePrimaryDestroy(final EventID
eventId) {
ew.event.release();
statistics.incUnprocessedEventsRemovedByPrimary();
return true;
+ } else if (addToUnprocessedTokens) {
+ // Secondary event may not have arrived
+ Long mapValue =
+ Long.valueOf(System.currentTimeMillis() +
AbstractGatewaySender.TOKEN_TIMEOUT);
+ Long oldv = this.unprocessedTokens.put(eventId, mapValue);
+ if (oldv == null) {
+ statistics.incUnprocessedTokensAddedByPrimary();
+ } else {
+ // its ok for oldv to be non-null
+ // this shouldn't happen anymore @todo add an assertion here
+ }
Review comment:
This empty block can probably be replaced with just a comment.
##########
File path:
geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialWANPersistenceEnabledGatewaySenderDUnitTest.java
##########
@@ -605,26 +603,21 @@ public void
testReplicatedRegionPersistentWanGateway_restartSenderWithCleanQueue
vm7.invoke(() ->
WANTestBase.createPersistentReplicatedRegion(getTestMethodName() + "_RR", "ln",
isOffHeap()));
- vm4.invoke(() -> WANTestBase.pauseSender("ln"));
- vm5.invoke(() -> WANTestBase.pauseSender("ln"));
-
- vm4.invoke(() -> WANTestBase.doPuts(getTestMethodName() + "_RR", 1000));
-
- logger.info("Completed puts in the region");
+ vm4.invoke("Puts in the region" + getTestMethodName() + "_RR",
+ () -> WANTestBase.doPuts(getTestMethodName() + "_RR", 1000));
- vm4.invoke(() -> WANTestBase.stopSender("ln"));
- vm5.invoke(() -> WANTestBase.stopSender("ln"));
+ vm4.invoke("Stopping ln sender", () -> WANTestBase.stopSender("ln"));
+ vm5.invoke("Stopping ln sender", () -> WANTestBase.stopSender("ln"));
- logger.info("Stopped all the senders. ");
-
- AsyncInvocation inv1 = vm4.invokeAsync(() ->
WANTestBase.startSenderwithCleanQueues("ln"));
- logger.info("Started the sender in vm 4");
+ createReceiverInVMs(vm2, vm3);
- vm5.invoke(() -> WANTestBase.startSenderwithCleanQueues("ln"));
- logger.info("Started the sender in vm 5");
+ AsyncInvocation inv1 = vm4.invokeAsync("Starting sender with clean queues",
Review comment:
The compiler warning here can be fixed by using `AsyncInvocation<?>
inv1`.
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderEventProcessor.java
##########
@@ -638,6 +639,17 @@ protected boolean basicHandlePrimaryDestroy(final EventID
eventId) {
ew.event.release();
statistics.incUnprocessedEventsRemovedByPrimary();
return true;
+ } else if (addToUnprocessedTokens) {
+ // Secondary event may not have arrived
+ Long mapValue =
+ Long.valueOf(System.currentTimeMillis() +
AbstractGatewaySender.TOKEN_TIMEOUT);
Review comment:
This can just be `Long mapValue = System.currentTimeMillis() +
AbstractGatewaySender.TOKEN_TIMEOUT;`
##########
File path:
geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialWANPersistenceEnabledGatewaySenderDUnitTest.java
##########
@@ -577,17 +577,15 @@ public void
testReplicatedRegionPersistentWanGateway_restartSenderWithCleanQueue
Integer nyPort = (Integer) vm1.invoke(() ->
WANTestBase.createFirstRemoteLocator(2, lnPort));
createCacheInVMs(nyPort, vm2, vm3);
- createReceiverInVMs(vm2, vm3);
createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
- String firstDStore = (String) vm4.invoke(() ->
WANTestBase.createSenderWithDiskStore("ln", 2,
- false, 100, 10, false, true, null, null, true));
- String secondDStore = (String) vm5.invoke(() ->
WANTestBase.createSenderWithDiskStore("ln", 2,
- false, 100, 10, false, true, null, null, true));
-
- logger.info("The first ds is " + firstDStore);
- logger.info("The second ds is " + secondDStore);
+ String firstDStore =
+ (String) vm4.invoke("Creating DS", () ->
WANTestBase.createSenderWithDiskStore("ln", 2,
+ false, 100, 10, false, true, null, null, true));
+ String secondDStore =
+ (String) vm5.invoke("Creating DS", () ->
WANTestBase.createSenderWithDiskStore("ln", 2,
+ false, 100, 10, false, true, null, null, true));
Review comment:
These variables are never used, so I think it should be okay to change
these to just
```
vm4.invoke("Creating DS", () -> WANTestBase.createSenderWithDiskStore("ln",
2, false, 100, 10,
false, true, null, null, true));
vm5.invoke("Creating DS", () -> WANTestBase.createSenderWithDiskStore("ln",
2, false, 100, 10,
false, true, null, null, true));
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]