@Override
    public void removeDiscovery(final DiscoveryDO discoveryDO) {
        ShenyuInstanceRegisterRepository shenyuDiscoveryService = discoveryServiceCache.remove(discoveryDO.getId());
        if (Objects.isNull(shenyuDiscoveryService)) {
            return;
        }
        if (discoveryServiceCache.values().stream().noneMatch(p -> p.equals(shenyuDiscoveryService))) {
            shenyuDiscoveryService.close();
            LOG.info("shenyu discovery shutdown [{}] discovery", discoveryDO.getName());
        }
    }
removeDiscovery by ShenyuDiscoveryService#shutdown .

@param discoveryDO discoveryDO
shenyu-admin/src/main/java/org/apache/shenyu/admin/discovery/AbstractDiscoveryProcessor.java