-
Notifications
You must be signed in to change notification settings - Fork 3.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
[fix][admin] Make failed bin/pulsar-admin source
command exit with code 1 (failed)
instead of 0 (success)
#20503
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JooHyukKim
changed the title
[fix][admin] Make failed
[fix][admin] Make failed Jun 6, 2023
CmdSources.run()
throw exceptions instead of silently-fail and returnsource
command return exit code 1
insteand of 0
JooHyukKim
changed the title
[fix][admin] Make failed
[fix][admin] Make failed Jun 6, 2023
source
command return exit code 1
insteand of 0
CmdSources
command return exit code 1
insteand of 0
JooHyukKim
changed the title
[fix][admin] Make failed
[fix][admin] Make failed Jun 6, 2023
CmdSources
command return exit code 1
insteand of 0
CmdSources
command return exit code 1
instead of 0
JooHyukKim
changed the title
[fix][admin] Make failed
[fix][admin] Make failed Jun 6, 2023
CmdSources
command return exit code 1
instead of 0
bin/pulsar-admin source
command exit with code 1(failed) instead of
0`(success)
JooHyukKim
changed the title
[fix][admin] Make failed
[fix][admin] Make failed Jun 6, 2023
bin/pulsar-admin source
command exit with code 1(failed) instead of
0`(success)bin/pulsar-admin source
command exit with code 1 (failed)
instead of 0 (success)
mattisonchao
reviewed
Jun 7, 2023
pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdSources.java
Show resolved
Hide resolved
tisonkun
approved these changes
Jun 7, 2023
mattisonchao
approved these changes
Jun 7, 2023
Codecov Report
@@ Coverage Diff @@
## master #20503 +/- ##
============================================
+ Coverage 72.05% 72.92% +0.87%
+ Complexity 31718 3697 -28021
============================================
Files 1855 1867 +12
Lines 138376 138544 +168
Branches 15198 15212 +14
============================================
+ Hits 99703 101038 +1335
+ Misses 30656 29483 -1173
- Partials 8017 8023 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Merging... Thanks for your contribution @JooHyukKim! |
15 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #20485
Motivation
As title describes, to help users be informed about failed command immediately (presumably automatically, for instances where scripts are written and used).
Currently, when
CmdSources
commands fail, process returns exit code0
even though the log shows it is apparently an error. For example, following commandbin/pulsar-admin sources create --source-config-file NON-EXISTENT-FILE.yaml
will log all error messages, but exit with code 0.Such current behavior is rooted in
CmdSources.BaseCommand.run()
method, whereException
thrown byprocessArguments()
is caught and "just" returns. This PR changes that.Modifications
CmdSources
:run()
to throw exceptions instead of silent-catch and return.Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: https://github.com/JooHyukKim/pulsar/pull/6