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

[FLINK-30761][coordination,test] Replaces JVM assert with Preconditions in leader election code #21738

Merged
merged 2 commits into from
Jan 24, 2023

Conversation

XComp
Copy link
Contributor

@XComp XComp commented Jan 20, 2023

What is the purpose of the change

The intention is to make the code more robust to test failures. We do no enable asserts in the test runs. The JVM has asserts disabled by default. That would mean that invalid state would go unnoticed if we continue to use assert instead of Preconditions.

Brief change log

  • replaced assert with Precondition checks

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

…ns in leader election code

The intention is to make the code more robust to test failures. We do
no enable asserts in the test runs. The JVM has asserts disabled
by default. That would mean that invalid state would go unnoticed if we
continue to use assert instead of Preconditions.

Signed-off-by: Matthias Pohl <matthias.pohl@aiven.io>
@XComp XComp requested a review from zentol January 20, 2023 09:58
@flinkbot
Copy link
Collaborator

flinkbot commented Jan 20, 2023

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@zentol zentol self-assigned this Jan 20, 2023
Signed-off-by: Matthias Pohl <matthias.pohl@aiven.io>
Copy link
Contributor

@zentol zentol left a comment

Choose a reason for hiding this comment

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

The changes look fine; let's see what CI says.

@XComp XComp merged commit b26c695 into apache:master Jan 24, 2023
chucheng92 pushed a commit to chucheng92/flink that referenced this pull request Feb 3, 2023
…ns in leader election code (apache#21738)

The intention is to make the code more robust to test failures. We do
no enable asserts in the test runs. The JVM has asserts disabled
by default. That would mean that invalid state would go unnoticed if we
continue to use assert instead of Preconditions.
akkinenivijay pushed a commit to krisnaru/flink that referenced this pull request Feb 11, 2023
…ns in leader election code (apache#21738)

The intention is to make the code more robust to test failures. We do
no enable asserts in the test runs. The JVM has asserts disabled
by default. That would mean that invalid state would go unnoticed if we
continue to use assert instead of Preconditions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants