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

MINOR: Refactor write timeout in CoordinatorRuntime #15976

Merged
merged 2 commits into from
May 17, 2024

Conversation

dajac
Copy link
Contributor

@dajac dajac commented May 16, 2024

This patch is a small refactor in the CoordinatorRuntime. It relies on existing tests for correctness.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@dajac dajac added the KIP-848 label May 16, 2024
@dajac dajac requested a review from chia7712 May 16, 2024 12:51
Copy link
Contributor

@chia7712 chia7712 left a 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();
Copy link
Contributor

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 :)

Copy link
Contributor Author

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,
Copy link
Contributor

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 + ")"

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@dajac dajac requested a review from chia7712 May 17, 2024 06:29
@chia7712 chia7712 merged commit 5b34574 into apache:trunk May 17, 2024
1 check failed
@dajac dajac deleted the minor-refactor-write-op-timeout branch May 21, 2024 06:47
rreddy-22 pushed a commit to rreddy-22/kafka-rreddy that referenced this pull request May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants