Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UpdateTask some logic errors #5028

Closed
haoyann opened this issue Mar 6, 2021 · 1 comment
Closed

UpdateTask some logic errors #5028

haoyann opened this issue Mar 6, 2021 · 1 comment
Labels
kind/bug Category issues or prs related to bug.
Milestone

Comments

@haoyann
Copy link
Collaborator

haoyann commented Mar 6, 2021

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.

@shalk
Copy link
Contributor

shalk commented Mar 6, 2021

this logic is added from #2546

@KomachiSion KomachiSion added this to the 2.0.0 milestone Mar 8, 2021
@KomachiSion KomachiSion added the kind/bug Category issues or prs related to bug. label Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Category issues or prs related to bug.
Projects
None yet
Development

No branches or pull requests

3 participants