Skip to content

Distinguish between timeout and task rejection in DefaultFuture #15698

@qxggg

Description

@qxggg

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues and found no similar feature requirement.

Apache Dubbo Component

Java SDK (apache/dubbo)

Descriptions

see #15671 and #15695

@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()) {
        try {
            executor.execute(() -> notifyTimeout(future));
        } catch (RejectedExecutionException e) {
            notifyTimeout(future);
            throw e;
        }
    } else {
        notifyTimeout(future);
    }
}

We have already solved #15671, but in PR #15695, @RainYuY thinks that we need another PR to change it so that it does not call notifyTimeout, because it’s not actually a timeout.(When error was caught).

Do you think we should do that?
If so, I can work on it.

Related issues

#15671
#15695

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

Metadata

Metadata

Assignees

Labels

type/enhancementEverything related with code enhancement or performance

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions