protected boolean basicHandlePrimaryDestroy(final EventID eventId,
      boolean addToUnprocessedTokens) {
    if (sender.isPrimary()) {
      // no need to do anything if we have become the primary
      return false;
    }
    GatewaySenderStats statistics = sender.getStatistics();
    // Get the event from the map
    synchronized (unprocessedEventsLock) {
      // If handleFailover() acquired the lock hence double checking
      if (sender.isPrimary()) {
        // no need to do anything if we have become the primary
        return false;
      }
      if (unprocessedEvents == null) {
        return false;
      }
      // now we can safely use the unprocessedEvents field
      EventWrapper ew = unprocessedEvents.remove(eventId);
      if (ew != null) {
        ew.event.release();
        statistics.incUnprocessedEventsRemovedByPrimary();
        return true;
      } else if (addToUnprocessedTokens) {
        // Secondary event may not have arrived
        if (logger.isTraceEnabled()) {
          logger.trace("{}: fromPrimary destroy event {} : added to unprocessed token map",
              sender.getId(), eventId);
        }
        Long mapValue =
            System.currentTimeMillis() + AbstractGatewaySender.TOKEN_TIMEOUT;
        Long oldv = unprocessedTokens.put(eventId, mapValue);
        if (oldv == null) {
          statistics.incUnprocessedTokensAddedByPrimary();
        }
      }
    }
    return false;
  }
Just remove the event from the unprocessed events map if it is present. This method added to
fix bug 37603
geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderEventProcessor.java