问题描述：线程1和线程2同时执行的情况下，线程1获取锁并创建registry实例然后释放锁，接着线程2获取锁并创建registry实例，最后线程1、2先后将registry存入registryManager中，导致重复创建registry对象

```
        registryManager.getRegistryLock().lock();
        try {
            // double check
            // fix https://github.com/apache/dubbo/issues/7265.
            defaultNopRegistry = registryManager.getDefaultNopRegistryIfDestroyed();
            if (null != defaultNopRegistry) {
                return defaultNopRegistry;
            }
            registry = registryManager.getRegistry(key);
            if (registry != null) {
                return registry;
            }
            //create registry by spi/ioc
            registry = createRegistry(url);
        } catch (Exception e) {
            if (check) {
                throw new RuntimeException("Can not create registry " + url, e);
            } else {
                LOGGER.warn("Failed to obtain or create registry ", e);
            }
        } finally {
            // Release the lock
            registryManager.getRegistryLock().unlock();
        }

        if (check && registry == null) {
            throw new IllegalStateException("Can not create registry " + url);
        }

        if (registry != null) {
            registryManager.putRegistry(key, registry);
        }
```

解决方法：执行registryManager.putRegistry(key, registry)之后再释放锁


if (check) {
                throw new RuntimeException("Can not create registry " + url, e);
            } else {
                LOGGER.warn("Failed to obtain or create registry ", e);
            }
        } finally {
            
            registryManager.getRegistryLock().unlock();
        }
        if (check && registry == null) {
            throw new IllegalStateException("Can not create registry " + url);
        }
        if (registry != null) {
            registryManager.putRegistry(key, registry);
        }
        return registry;
    }
    /**
     * Create the key for the registries cache.
     * This method may be overridden by the sub-class.
     *
     * @param url the registration {@link URL url}
     * @return non-null
     */
    protected String createRegistryCacheKey(URL url) {
        return url.toServiceStringWithoutResolving();
    }
    protected abstract Registry createRegistry(URL url);
}