-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fix the bug that masterOperation(with task param) is bypassed #4103
Fix the bug that masterOperation(with task param) is bypassed #4103
Conversation
Signed-off-by: Tianli Feng <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
@@ Coverage Diff @@
## main #4103 +/- ##
=========================================
Coverage 70.56% 70.57%
- Complexity 56938 56994 +56
=========================================
Files 4588 4588
Lines 274132 274132
Branches 40178 40178
=========================================
+ Hits 193454 193477 +23
+ Misses 64452 64431 -21
+ Partials 16226 16224 -2
Help us with your feedback. Take ten seconds to tell us how you rate us. |
…bstract Signed-off-by: Tianli Feng <[email protected]>
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.
Thanks @tlfeng for the fix.
@dreamer-89 @reta Thanks a lot for your review! |
@@ -218,7 +222,7 @@ protected void doStart(ClusterState clusterState) { | |||
} | |||
}); | |||
threadPool.executor(executor) | |||
.execute(ActionRunnable.wrap(delegate, l -> clusterManagerOperation(task, request, clusterState, l))); | |||
.execute(ActionRunnable.wrap(delegate, l -> masterOperation(task, request, clusterState, l))); |
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.
May be we could keep the clusterManagerOperation
but change its delegation model:
protected void clusterManagerOperation(Task task, Request request, ClusterState state, ActionListener<Response> listener)
throws Exception {
masterOperation(task, request, state, listener);
}
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.
Thank you for the suggestion! It make sense, in this way, the benefit is there will be no references of the master
name methods, but the disadvantage is there will be more work in changing the method definitions when removing the deprecated ones.
I will have a try to change in this way.
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.
Changed in the commit d4ec950, thanks for your brilliant idea! 😄
Gradle Check (Jenkins) Run Completed with:
|
…o call masterOperation(task...) Signed-off-by: Tianli Feng <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
The method `protected void masterOperation(Task task, Request request, ClusterState state, ActionListener<Response> listener)` was not properly deprecated by the commit 2a1b239 / PR #403. There is a problem that it doesn't make any difference to whether overriding the method `void masterOperation(Task task, Request request, ClusterState state, ActionListener<Response> listener)` or not. The reason is the only usage for the method changed to call another method `clusterManagerOperation(task, request, clusterState, l)`, which is the default implementation for the method `masterOperation(with task param)`. There is no other usage for the method `masterOperation()` so it's bypassed. In the commit: - Change delegation model for method `clusterManagerOperation(with task param)` to call `masterOperation(with task param)`, according to the comment below #4103 (comment) - Add a test to validate the backwards compatibility, which copied and modified from an existing test. Signed-off-by: Tianli Feng <[email protected]> (cherry picked from commit 3ab0d1f)
The method `protected void masterOperation(Task task, Request request, ClusterState state, ActionListener<Response> listener)` was not properly deprecated by the commit 2a1b239 / PR #403. There is a problem that it doesn't make any difference to whether overriding the method `void masterOperation(Task task, Request request, ClusterState state, ActionListener<Response> listener)` or not. The reason is the only usage for the method changed to call another method `clusterManagerOperation(task, request, clusterState, l)`, which is the default implementation for the method `masterOperation(with task param)`. There is no other usage for the method `masterOperation()` so it's bypassed. In the commit: - Change delegation model for method `clusterManagerOperation(with task param)` to call `masterOperation(with task param)`, according to the comment below #4103 (comment) - Add a test to validate the backwards compatibility, which copied and modified from an existing test. Signed-off-by: Tianli Feng <[email protected]> (cherry picked from commit 3ab0d1f)
…#4115) The method `protected void masterOperation(Task task, Request request, ClusterState state, ActionListener<Response> listener)` was not properly deprecated by the commit 2a1b239 / PR #403. There is a problem that it doesn't make any difference to whether overriding the method `void masterOperation(Task task, Request request, ClusterState state, ActionListener<Response> listener)` or not. The reason is the only usage for the method changed to call another method `clusterManagerOperation(task, request, clusterState, l)`, which is the default implementation for the method `masterOperation(with task param)`. There is no other usage for the method `masterOperation()` so it's bypassed. In the commit: - Change delegation model for method `clusterManagerOperation(with task param)` to call `masterOperation(with task param)`, according to the comment below #4103 (comment) - Add a test to validate the backwards compatibility, which copied and modified from an existing test. Signed-off-by: Tianli Feng <[email protected]> (cherry picked from commit 3ab0d1f)
Description
The method
protected void masterOperation(Task task, Request request, ClusterState state, ActionListener<Response> listener)
was not properly deprecated by the commit 2a1b239 / PR #403.There is a problem that it doesn't make any difference to whether overriding the method
void masterOperation(Task task, Request request, ClusterState state, ActionListener<Response> listener)
or not.The reason is the only usage for the method changed to call another method
clusterManagerOperation(task, request, clusterState, l)
, which is the default implementation for the methodmasterOperation(with task param)
. There is no other usage for the methodmasterOperation()
so it's bypassed.In the PR:
I restored the usage of the methodmasterOperation(with task param)
clusterManagerOperation(with task param)
to callmasterOperation(with task param)
, according to the comment below Fix the bug that masterOperation(with task param) is bypassed #4103 (comment)Issues Resolved
Resolve #4062
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.