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 and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

when i set threadPool with my custom threadPool . it may be executor reject exception when submit processTask in DefaultFuture.

The map of Futures cache may can not be clear for long time.

Is it necessary to try this kind of exception.

private static final Map<Long, DefaultFuture> FUTURES = new ConcurrentHashMap<>();
  @Override
        public void run(Timeout timeout) {
            DefaultFuture future = DefaultFuture.getFuture(requestID);
            if (future == null || future.isDone()) {
                return;
            }

            ExecutorService executor = future.getExecutor();
            if (executor != null && !executor.isShutdown()) {
                executor.execute(() -> notifyTimeout(future));
            } else {
                notifyTimeout(future);
            }
        }

Steps to reproduce this issue

  1. set custom thread pool in consumer side
  2. set core thread and max thread and use limited queue
  3. when process task can not be processed the future remain in the memory

What you expected to happen

the dump of application, I use MAT to search futureMap. It keeps a future which associate with request send 3 hours ago.

Anything else

only when certain situation happened.

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

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

Code of Conduct

Comment From: qxggg

Hi, I’m a student and this would be my first open source contribution. Could you please assign this issue to me if it’s still available? Thanks!

Comment From: wcy666103

Hi, I’m a student and this would be my first open source contribution. Could you please assign this issue to me if it’s still available? Thanks!

Just go ahead.

Comment From: qxggg

Hi, I’m a student and this would be my first open source contribution. Could you please assign this issue to me if it’s still available? Thanks!

Just go ahead.

Thanks for assigning this to me! This is my first time contributing to open source, so I may need a bit more time to get familiar with the project. I really appreciate your patience.