- [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
- [ ] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: 2.7.x
* Operating System version: Mac OS
* Java version: N/A

### Steps to reproduce this issue

Run dubbo-demo project

1. Use consul as registry center
2. Start provider
3. Start consumer

Pls. provide [GitHub address] to reproduce this issue.

### Expected Result

The consumer can exit as usual

### Actual Result

The consumer cannot exit.

If there is an exception, please attach the exception trace:

```
Just put your stack trace here!
```

}
        super.register(url);
    }
    @Override
    public void doRegister(URL url) {
        client.agentServiceRegister(buildService(url));
    }
    @Override
    public void unregister(URL url) {
        if (isConsumerSide(url)) {
            return;
        }
        super.unregister(url);
    }
    @Override
    public void doUnregister(URL url) {
        client.agentServiceDeregister(buildId(url));
    }
    @Override
    public void subscribe(URL url, NotifyListener listener) {
        if (isProviderSide(url)) {
            return;
        }
        super.subscribe(url, listener);
    }
    @Override
    public void doSubscribe(URL url, NotifyListener listener) {
        Long index;
        List<URL> urls;
        if (ANY_VALUE.equals(url.getServiceInterface())) {