public static void cancelTimers(DistributedSystem system) {
    Set<WeakReference<SystemTimer>> timers;
    synchronized (distributedSystemTimers) {
      timers = distributedSystemTimers.get(system);
      if (timers == null) {
        return; // already cancelled
      }
      // Remove before releasing synchronization, so any fresh timer ends up
      // in a new set with same key
      distributedSystemTimers.remove(system);
    } // synchronized

    // cancel all of the timers
    synchronized (timers) {
      for (WeakReference<SystemTimer> wr : timers) {
        SystemTimer st = wr.get();
        // it.remove(); Not necessary, we're emptying the list...
        if (st != null) {
          st.cancelled = true; // for safety :-)
          st.timer.cancel(); // st.cancel() would just search for it again
        }
      }
    }
  }
Cancel all outstanding timers

@param system the DistributedSystem whose timers should be cancelled
geode-core/src/main/java/org/apache/geode/internal/SystemTimer.java