Thanks to visit codestin.com
Credit goes to github.com

Skip to content

UpdateTask some logic errors #5028

@haoyann

Description

@haoyann

Describe the bug
Finally code block will always execute. So incFailCount() will always execute. And when queryInstancesOfService error delayTime = -1, this task will also be stopped.
Why need add delayTime > 0 check , should a default value be given.

}
// TODO multiple time can be configured.
delayTime = serviceObj.getCacheMillis() * DEFAULT_UPDATE_CACHE_TIME_MULTIPLE;
resetFailCount();
} catch (Throwable e) {
NAMING_LOGGER.warn("[NA] failed to update serviceName: " + groupedServiceName, e);
} finally {
incFailCount();
if (delayTime > 0) {
executor.schedule(this, Math.min(delayTime << failCount, DEFAULT_DELAY * 60), TimeUnit.MILLISECONDS);
}
}

Desktop (please complete the following information):

  • OS: [e.g. Centos]
  • Version [e.g. nacos-server 2.0.0, nacos-client 2.0.0]
  • Module [e.g. naming]
  • SDK [java]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategory issues or prs related to bug.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions