[ 
https://issues.apache.org/jira/browse/GEODE-8478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17189614#comment-17189614
 ] 

ASF GitHub Bot commented on GEODE-8478:
---------------------------------------

DonalEvans commented on a change in pull request #5494:
URL: https://github.com/apache/geode/pull/5494#discussion_r482268033



##########
File path: 
geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySenderEventProcessor.java
##########
@@ -1037,24 +1039,32 @@ public void handleSuccessBatchAck(int batchId) {
       }
       eventQueueRemove(events.size());
 
-      final GatewaySenderStats statistics = this.sender.getStatistics();
+      logThresholdExceededAlerts(events);
+    }
+  }
 
-      // Log an alert for each event if necessary
-      if (this.sender.getAlertThreshold() > 0) {
-        Iterator it = events.iterator();
-        long currentTime = System.currentTimeMillis();
-        while (it.hasNext()) {
+  protected void logThresholdExceededAlerts(List<GatewaySenderEventImpl> 
events) {
+    // Log an alert for each event if necessary
+    if (getSender().getAlertThreshold() > 0) {
+      Iterator it = events.iterator();
+      long currentTime = System.currentTimeMillis();
+      while (it.hasNext()) {
+        try {
           Object o = it.next();
           if (o != null && o instanceof GatewaySenderEventImpl) {

Review comment:
       This null check is redundant, since it's implicitly included in the 
`instanceof` check.




----------------------------------------------------------------
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:
us...@infra.apache.org


> Exceptions that occur while logging threshold exceeded alerts cause the 
> GatewaySender to shutdown
> -------------------------------------------------------------------------------------------------
>
>                 Key: GEODE-8478
>                 URL: https://issues.apache.org/jira/browse/GEODE-8478
>             Project: Geode
>          Issue Type: Bug
>          Components: wan
>            Reporter: Barrett Oglesby
>            Assignee: Barrett Oglesby
>            Priority: Major
>              Labels: pull-request-available
>
> Exceptions that occur while logging threshold exceeded alerts cause the 
> GatewaySender to shutdown
> If an exception occurs while logging threshold exceeded alerts, a fatal 
> message and warnings like these are logged:
> {noformat}
> [fatal 2020/07/27 05:23:05.911 EDT <AckReaderThread for : Event Processor for 
> GatewaySender_mySender_5> tid=0x17487] Stopping the processor because the 
> following exception occurred while processing a batch:
> java.lang.IllegalArgumentException: The Object passed in should not be null.
>   ...
>       at 
> org.apache.geode.internal.cache.wan.GatewaySenderEventImpl.getValueAsString(GatewaySenderEventImpl.java:615)
>       at 
> org.apache.geode.internal.cache.wan.AbstractGatewaySenderEventProcessor.handleSuccessBatchAck(AbstractGatewaySenderEventProcessor.java:1053)
>       at 
> org.apache.geode.internal.cache.wan.GatewaySenderEventRemoteDispatcher$AckReaderThread.run(GatewaySenderEventRemoteDispatcher.java:636)
> [warn 2020/07/27 05:23:05.927 EDT <Event Processor for 
> GatewaySender_mySender_5> tid=0xdb] Pool unexpected Socket closed 
> connection=Pooled Connection to xxx:12028: Connection[DESTROYED]). Server 
> unreachable: could not connect after 1 attempts
> [warn 2020/07/27 05:23:20.916 EDT <AckReaderThread for : Event Processor for 
> GatewaySender_mySender_5> tid=0x17487] AckReaderThread ignored cancellation
> [warn 2020/07/27 05:23:20.921 EDT <AckReaderThread for : Event Processor for 
> GatewaySender_mySender_5> tid=0x17487] Destroying GatewayEventDispatcher with 
> actively queued data.
> {noformat}
> The catch block in {{GatewaySenderEventRemoteDispatcher$AckReaderThread.run}} 
> stops the processor.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to