Skip to content

对于FailedNotifiedTask类doRetry方法的疑问 #5894

@yoozoom

Description

@yoozoom
  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.7.6
  • Operating System version: win10
  • Java version: 1.8

Steps to reproduce this issue

对于FailedNotifiedTask类doRetry方法的疑问

  1. 为什么要无差别reput这个任务,使他执行3次(默认重试次数)
  2. 为什么调用listener.notify(urls)来进行重试。正常逻辑是调用FailbackRegistry.notify,再调用listener.notify。FailbackRegistry.notify和listener.notify中间相差很多逻辑,为什么在重试任务中直接使用listener.notify而忽略了相差的逻辑

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

Expected Result

@Override
protected void doRetry(URL url, FailbackRegistry registry, Timeout timeout) {
    if (CollectionUtils.isNotEmpty(urls)) {
        registry.doNotify(urls);
        urls.clear();
    }
    //reput(timeout, retryPeriod);
}

Actual Result

@Override
protected void doRetry(URL url, FailbackRegistry registry, Timeout timeout) {
    if (CollectionUtils.isNotEmpty(urls)) {
        listener.notify(urls);
        urls.clear();
    }
    reput(timeout, retryPeriod);
}

理解不深,烦请解答。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions