You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2023/01/20 09:58:05 UTC
[GitHub] [flink] XComp opened a new pull request, #21738: [FLINK-30761][coordination,test] Replaces JVM assert with Preconditions in leader election code
XComp opened a new pull request, #21738:
URL: https://github.com/apache/flink/pull/21738
## 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] XComp merged pull request #21738: [FLINK-30761][coordination,test] Replaces JVM assert with Preconditions in leader election code
Posted by "XComp (via GitHub)" <gi...@apache.org>.
XComp merged PR #21738:
URL: https://github.com/apache/flink/pull/21738
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] zentol commented on a diff in pull request #21738: [FLINK-30761][coordination,test] Replaces JVM assert with Preconditions in leader election code
Posted by GitBox <gi...@apache.org>.
zentol commented on code in PR #21738:
URL: https://github.com/apache/flink/pull/21738#discussion_r1082324266
##########
flink-runtime/src/test/java/org/apache/flink/runtime/leaderelection/TestingLeaderElectionService.java:
##########
@@ -48,7 +49,7 @@ public synchronized CompletableFuture<LeaderConnectionInfo> getConfirmationFutur
@Override
public synchronized void start(LeaderContender contender) {
- assert (!getStartFuture().isDone());
+ Preconditions.checkState(getStartFuture().isDone());
Review Comment:
```suggestion
Preconditions.checkState(!getStartFuture().isDone());
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot commented on pull request #21738: [FLINK-30761][coordination,test] Replaces JVM assert with Preconditions in leader election code
Posted by GitBox <gi...@apache.org>.
flinkbot commented on PR #21738:
URL: https://github.com/apache/flink/pull/21738#issuecomment-1398166208
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "b6fb5cacd48f5c91c7cf27ea45395696b2eb04f8",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "b6fb5cacd48f5c91c7cf27ea45395696b2eb04f8",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* b6fb5cacd48f5c91c7cf27ea45395696b2eb04f8 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] XComp commented on a diff in pull request #21738: [FLINK-30761][coordination,test] Replaces JVM assert with Preconditions in leader election code
Posted by GitBox <gi...@apache.org>.
XComp commented on code in PR #21738:
URL: https://github.com/apache/flink/pull/21738#discussion_r1082412814
##########
flink-runtime/src/test/java/org/apache/flink/runtime/leaderelection/TestingLeaderElectionService.java:
##########
@@ -48,7 +49,7 @@ public synchronized CompletableFuture<LeaderConnectionInfo> getConfirmationFutur
@Override
public synchronized void start(LeaderContender contender) {
- assert (!getStartFuture().isDone());
+ Preconditions.checkState(getStartFuture().isDone());
Review Comment:
args - good catch. :+1: fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org