-
Notifications
You must be signed in to change notification settings - Fork 93
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
[crmsh-4.5] Fix: Raise an exception as a rapid return of ssh-related operations to prevent hang (bsc#1228899) #1508
[crmsh-4.5] Fix: Raise an exception as a rapid return of ssh-related operations to prevent hang (bsc#1228899) #1508
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## crmsh-4.5 #1508 +/- ##
==============================================
+ Coverage 52.41% 66.20% +13.78%
==============================================
Files 78 78
Lines 25123 25448 +325
==============================================
+ Hits 13169 16848 +3679
+ Misses 11954 8600 -3354
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
- If there are
core.hosts
incrm.conf
,_guess_user_for_ssh
will not be called. So this patch will not respectno_ssh
incrm.conf
if there arecore.hosts
. Please checkno_ssh
inUserOfHost.user_pair_for_ssh
. ssh_command()
is not used by other modules. Why is it a public function?
34cbaf9
to
8181608
Compare
Default value is 'no'. When ssh between cluster nodes is blocked, set it to 'yes' to avoid ssh hang.
8181608
to
700f12b
Compare
700f12b
to
62d3dc2
Compare
When checking the status of the cluster on peers, catch utils.NoSSHError exception
62d3dc2
to
0682bb1
Compare
709eb21
to
1cb9336
Compare
Major use cases
|
crmsh/main.py
Outdated
@@ -367,6 +367,9 @@ def run(): | |||
else: | |||
upgradeutil.upgrade_if_needed() | |||
return main_input_loop(context, user_args) | |||
except utils.NoSSHError as msg: | |||
logger.error(msg) |
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.
logger.error(msg) | |
logger.error('%s', msg) |
…local mode (bsc#1228899) Avoid raising NoSSHError exception as an error
…al mode (bsc#1228899)
1cb9336
to
e87d325
Compare
Problem
In some environments with a network firewall dropping ssh packets, any ssh operation could hang.
Solution
"no" is the default.
"yes" means all ssh-related operations are disabled and will directly return on purpose.
no_ssh
isyes
.utils.NoSSHError
inmain
so that SSH-related commands will log a general error message:ERROR: ssh-related operations are disabled. crm report works in local mode.
upgradeutil
, which is called regardless of the command being called, will return without calling ssh, whenno_ssh
isyes
.SSH related commands