-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
MINOR: Refactor write timeout in CoordinatorRuntime #15976
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dajac nice refactor. two small comments PTAL
|
||
@Override | ||
public void run() { | ||
String name = event.toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not include if (!future.isDone()) {
now. Is it ok? I don't have much context :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need it anymore because we cancel the timer when the operation is completed. The future is completed at the same time so it is equivalent.
@Override | ||
public void run() { | ||
String name = event.toString(); | ||
scheduleInternalOperation("OperationTimeout", tp, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
previous operation name carries more information. Should we keep it? for instance: "OperationTimeout(name=" + name + ", tp=" + tp + ")"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me add it back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
This patch is a small refactor in the CoordinatorRuntime. It relies on existing tests for correctness.
Committer Checklist (excluded from commit message)