apache / apache/dubbo

[Bug] Directory of type RegistryDirectory already destroyed for service

Open
#15,798 6 comments 0 reactions 1 assignee Claimed by @arunikayadav42 View on GitHub
help wanted
Dominant language
Java
Stars
41.6k
Forks
26.4k
Avg merge
15h 13m
Merged PRs (30d)
4

Description

### Pre-check

- [x] I am sure that all the content I provide is in English.

### Search before asking

- [x] I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no similar issues.

### Apache Dubbo Component

Java SDK (apache/dubbo)

### Dubbo Version

openjdk: 1.8 dubbo: 3.2.0

### Steps to reproduce this issue

Because Dubbo for Spring Boot starts to destroy itself immediately after receiving the ContextClosedEvent, while the Spring Boot scheduled task (ThreadPoolTaskScheduler) is destroyed later during the DisposableBean.destroy() phase, the destruction order becomes inconsistent.

As a result, Dubbo is destroyed before the scheduled tasks are stopped. If those tasks continue to invoke Dubbo remote services during this period, they will throw the following error:

```
org.apache.dubbo.rpc.RpcException: Directory of type RegistryDirectory already destroyed for service
```

### What you expected to happen

Support graceful shutdown

### Anything else

_No response_

### Are you willing to submit a pull request to fix on your own?

- [ ] Yes I am willing to submit a pull request on my own!

### Code of Conduct

- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.