-
Notifications
You must be signed in to change notification settings - Fork 122
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
Bash functions cp_vrfy
, mv_vrfy
, etc., do not actually verify success
#861
Labels
Comments
mkavulich
added a commit
to mkavulich/ufs-srweather-app
that referenced
this issue
Jul 18, 2023
- Remove usage of "*_vrfy" functions due to issues mentioned in Issue 861 (ufs-community#861) - Remove extra "mkdir" statement where it shouldn't be for MRMS - Use correct variable (vhh_noZero) for checking valid hour for NDAS
mkavulich
added a commit
to mkavulich/ufs-srweather-app
that referenced
this issue
Jul 20, 2023
- Remove usage of "*_vrfy" functions due to issues mentioned in Issue 861 (ufs-community#861) - Remove extra "mkdir" statement where it shouldn't be for MRMS - Use correct variable (vhh_noZero) for checking valid hour for NDAS
mkavulich
added a commit
to mkavulich/ufs-srweather-app
that referenced
this issue
Jul 25, 2023
- Remove usage of "*_vrfy" functions due to issues mentioned in Issue 861 (ufs-community#861) - Remove extra "mkdir" statement where it shouldn't be for MRMS - Use correct variable (vhh_noZero) for checking valid hour for NDAS
mkavulich
added a commit
to mkavulich/ufs-srweather-app
that referenced
this issue
Aug 15, 2023
- Remove usage of "*_vrfy" functions due to issues mentioned in Issue 861 (ufs-community#861) - Remove extra "mkdir" statement where it shouldn't be for MRMS - Use correct variable (vhh_noZero) for checking valid hour for NDAS
Just a follow-up on my original comment about |
16 tasks
MichaelLueken
added a commit
that referenced
this issue
Apr 30, 2024
…ands (#1074) The weather model hash has been updated to 4f32a4b (April 15). Additionally, _vrfy has been removed from the cd, cp, ln, mkdir, mv, and rm bash commands in jobs, scripts, ush, and ush/bash_utils. The modified commands don't function as intended (issue #861) and aren't accepted by NCO (issue #1021).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected behavior
There is a set of bash functions named "*_vrfy" that are meant to verify the success of a system command, such as
cp
,mv
, etc. In the past, I have thought these were mostly harmless, if redundant, since for most functions, any failure will result in a descriptive errorCurrent behavior
As it turns out, these function are dangerously masking failures rather than giving more information about them. For example, if you want to verify a file was copied with cp_vrfy, but that file does not exist, a message will be printed out, but the exit code will be set to 0, and the program will happily hum along with no failure. This is in opposition to the UNIX built-in cp function, which does fail for a non-existent file.
These functions are not adding functionality, they are taking away functionality, and are actively harmful to the workflow's utility.
Machines affected
Likely all, tested on Jet and Cheyenne
Steps To Reproduce
Attached is a script that can be run from the ush/ directory that demonstrates this incorrect and pernicious behavior. It must be run from a successfully created experiment directory (this is another frustrating thing about the bash utilites: they are very hard to test on their own without an existing experiment already set up)
cp_vrfy
,mv_vrfy
,mkdir_vrfy
,rm_vrfy
, andln_vrfy
never produce a failure even when they should.cd_vrfy
produces the same failure as cdln
does not fail when creating a broken link; this is the one additional functionality we might need (butln_vrfy
does not currently provide)Detailed Description of Fix
I don't think this bug is worth fixing, these functions should be deprecated and removed. See below.
Possible Implementation
Use the "set -e" flag to have scripts exit on an error, so we can use the built-in unix utilities instead of these custom functions.
We should also ditch the _vrfy functions (aside from maybe ln_vrfy, which will need some work to function as desired to fail when a broken link is created). They are redundant to bash's built-in ability to exit on an error, and represent a huge amount of bulk and unnecessary potential failure modes to the workflow.
Output
This is the above-mentioned test script in its entirety. Again, it must be run from a valid experiment directory in order to get the "var_defns.sh" file.
The text was updated successfully, but these errors were encountered: