-
Notifications
You must be signed in to change notification settings - Fork 249
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
Increase USER_INPUT_INTERRUPT_TIMEOUT default from 10 to 30 seconds #2981
Conversation
In default.conf incresed the default USER_INPUT_INTERRUPT_TIMEOUT from 10 seconds to 30 seconds because 10 seconds is far too little time to read and understand the possibly unexpected UserInput() message and then some more time to make a decision whether or not the automated action is actually the right one.
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.
Good change.
In general I feel that we don't need to explain how export
works for every variable that can be set from the outside.
If we use the :-
syntax consistently then it becomes very simple to quickly check for such variables via grep
:
$ grep :- usr/share/rear/conf/default.conf
KERNEL_VERSION="${KERNEL_VERSION:-$( uname -r )}"
GALAXY11_BACKUPSET=${GALAXY11_BACKUPSET:-}
GALAXY11_PIT_RECOVERY=${GALAXY11_PIT_RECOVERY:-}
GALAXY11_USER=${GALAXY11_USER:-}
GALAXY11_PASSWORD=${GALAXY11_PASSWORD:-}
Whereas grepping for test
yields way too many false positives.
In default.conf use VAR="${VAR:-default value}" instead of test "$VAR"|| VAR="default value" because 'grep' for ':-' works better to find those assignments in contrast to 'grep' for 'test' that also shows many false positives see #2981 Furthermore regarding why we do not use : "${VAR:=default value}" see https://stackoverflow.com/questions/4437573/bash-assign-default-value i.e. VAR="${VAR:-default value}" is found by 'grep' for 'VAR=' and with 'set -x' it shows VAR='default value' (instead of : 'default value') which makes this code easier to understand, debug and maintain, cf. https://github.com/rear/rear/wiki/Coding-Style
@schlomo Additionlly
is better in practice than
cf. my comment in
|
I am wondering why we use
and not
i.e. why we assign 'defult value' via In the former case the user cannot set an empty value via
which he could do (if needed) in the latter case. As far as I see this does not matter with the current So my question is currently only out of curiosity. |
I have another question: What is "the best" way to assign a string of words Currenly I use an unquoted string
in
because we do it this way already in
and
Alternatively
would work but the nested double quotes look confusing.
do not work because (at least with bash version 4.4.23)
the single quotes become part of the assigned value. |
@jsmeix the examples in What is bad with I don't see a need to change anything from our current use of this parameter substitution and it seems to me that there is no need for inner quotes around multi word default values either. |
By the way regarding As far as I found we have only one case where this is used:
It seems to be allowed to call get_device_from_partition get_device_from_partition is only called in @pcahyna |
No memories, most likely I did it wrong. Off the top of my head I'm not aware of any reason to use Personally, I also find |
Ah yes, that would explain my lack of memory. Well spotted 😄 |
In default.conf use the VAR="${VAR:-default value}" form also for { BACKUP_PROG_CRYPT_KEY="${BACKUP_PROG_CRYPT_KEY:-}" ; } 2>/dev/null see #2981 (comment) and explain why the confidential way via { confidential_command ; } 2>/dev/null is also used in default.conf (as template how to do it properly in etc/rear/local.conf) cf. #2967 (comment)
I did |
Oh - right now I found in default.conf
|
I will do a new pull request to clean up in default.conf |
In layout/recreate/default/120_confirm_wipedisk_disks.sh fixed comment about the USER_INPUT_INTERRUPT_TIMEOUT default because since #2981 USER_INPUT_INTERRUPT_TIMEOUT is by default 30 seconds
In layout/prepare/Linux-s390/370_confirm_dasd_format_code.sh fixed comment about the USER_INPUT_INTERRUPT_TIMEOUT default because since #2981 USER_INPUT_INTERRUPT_TIMEOUT is by default 30 seconds
Type: Enhancement
Impact: Normal
How was this pull request tested?
In current GitHub master code since DISKS_TO_BE_WIPED="" cf.
#2859
there is in layout/recreate/default/120_confirm_wipedisk_disks.sh
a UserInput() dialog like
which has usually (i.e. when not in MIGRATION_MODE)
a timeout of USER_INPUT_INTERRUPT_TIMEOUT.
During my tests with current GitHub master code
I learned that 10 seconds is far too little time
to read and understand that UserInput message and
then some more time to make a decision whether or not
the automated action is actually the right one.
I.e. 10 seconds was far too little time even for me
where I expected that UserInput dialog but even I
could not actually comprehend what disks will be wiped
and I could not at all make a decision whether or not
those are the right disks.
So the same applies to any UserInput dialog
(in prticular to any unexpected UserInput dialog)
where USER_INPUT_INTERRUPT_TIMEOUT is used
i.e. any UserInput() dialog with a predefined input.
In general a default timeout is useless when it is too short
to let the user understand what is going on and let him
make a decision so in practice such a too short timeout
behaves very user unfiendly.
In default.conf increased the default USER_INPUT_INTERRUPT_TIMEOUT
from 10 seconds to 30 seconds because 10 seconds is far too little time
to read and understand a possibly unexpected UserInput() message
and then some more time to make a decision whether or not
the automated action is actually the right one.