docs: protected boolean internalCancel(String appName, String id, boolean isReplication) {
          try {
              read.lock();
              CANCEL.increment(isReplication);
              Map<String, Lease<InstanceInfo>> gMap = registry.get(appName);
              Lease<InstanceInfo> leaseToCancel = null;
              if (gMap != null) {
                  leaseToCancel = gMap.remove(id);
              }
              synchronized (recentCanceledQueue) {
                  recentCanceledQueue.add(new Pair<Long, String>(System.currentTimeMillis(), appName + "(" + id + ")"));
              }
              InstanceStatus instanceStatus = overriddenInstanceStatusMap.remove(id);
              if (instanceStatus != null) {
                  logger.debug("Removed instance id {} from the overridden map which has value {}", id, instanceStatus.name());
              }
              if (leaseToCancel == null) {
                  CANCEL_NOT_FOUND.increment(isReplication);
                  logger.warn("DS: Registry: cancel failed because Lease is not registered for: {}/{}", appName, id);
                  return false;
              } else {
                  leaseToCancel.cancel();
                  InstanceInfo instanceInfo = leaseToCancel.getHolder();
                  String vip = null;
                  String svip = null;
                  if (instanceInfo != null) {
                      instanceInfo.setActionType(ActionType.DELETED);
                      recentlyChangedQueue.add(new RecentlyChangedItem(leaseToCancel));
                      instanceInfo.setLastUpdatedTimestamp();
                      vip = instanceInfo.getVIPAddress();
                      svip = instanceInfo.getSecureVipAddress();
                  }
                  invalidateCache(appName, vip, svip);
                  logger.info("Cancelled instance {}/{} (replication={})", appName, id, isReplication);
                  return true;
              }
          } finally {
              read.unlock();
          }
      }