private void disableEntryExpiryTasks() {
    int oldTimeToLive = region.getEntryTimeToLive().getTimeout();
    if (oldTimeToLive > 0) {
      ExpirationAttributes ea = new ExpirationAttributes(0, // disables expiration
          ExpirationAction.LOCAL_INVALIDATE);
      region.setEntryTimeToLive(ea);
      region.setCustomEntryTimeToLive(new ThreadIdentifierCustomExpiry());
      logger.info(
          "Entry expiry tasks disabled because the queue became primary. Old messageTimeToLive was: {}",
          oldTimeToLive);
    }
  }
Disables EntryExpiryTask for the HARegion ({@code this.region}).
geode-core/src/main/java/org/apache/geode/internal/cache/ha/HARegionQueue.java