-
Couldn't load subscription status.
- Fork 203
Replace cp with cpfs/cpreq for atomic copies to COM directories #4130
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
Replace cp with cpfs/cpreq for atomic copies to COM directories #4130
Conversation
Co-authored-by: DavidHuber-NOAA <[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.
The change in ush/wave_prnc_ice.sh is fine.
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.
looks ok.
@copilot Are these the only place where cp is being used now?
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.
copying dev/null is the same as touching the file
Co-authored-by: Rahul Mahajan <[email protected]>
…ed-45fd-4baa-9f7e-6bcebdc16050
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.
The changes to the 3 minmon scripts look good to me.
|
Launching CI on WCOSS2. |
|
All tests passed on WCOSS2. Awaiting approval from @aerorahul before merging. |
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.
A few suggestions, some questions.
ush/minmon_xtrct_costs.pl
Outdated
| if( -e $filename2 ) { | ||
| my $newfile2 = "${tankdir}/${filename2}"; | ||
| system("cp -f $filename2 $newfile2"); | ||
| system("cpreq -f $filename2 $newfile2"); |
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.
why cpreq and not cpfs?
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.
also, does cpreq take -f?
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.
Probably don't need it regardless.
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.
Fixed.
ush/minmon_xtrct_reduct.pl
Outdated
| if( -e $outfile ) { | ||
| my $newfile = "${tankdir}/${outfile}"; | ||
| system("cp -f $outfile $newfile"); | ||
| system("cpfs -f $outfile $newfile"); |
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.
| system("cpfs -f $outfile $newfile"); | |
| system("cpfs $outfile $newfile"); |
Does cpfs take -f?
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.
No it does not.
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.
Fixed.
ush/minmon_xtrct_gnorms.pl
Outdated
|
|
||
| if( -e $filename2 ) { | ||
| system("cp -f $filename2 ${tankdir}/."); | ||
| system("cpfs -f $filename2 ${tankdir}/."); |
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.
same here and a few other places
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.
All fixed.
|
I note in the logs the following error messages from the So any errors from the minimization package are not being handled correctly. I'll open up a follow-up issue for this. |
|
Rerunning all 4 |
|
Opened #4171 as a follow-up issue to harden the minimization scripts. |
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.
lgtm.
Description
This PR addresses issue #3051 by replacing standard
cpcommands with atomic copy utilities (cpfsandcpreqfromprod_util) for all copies to COM directories. This is required per NCO Implementation Standards v11 to prevent downstream programs from accessing incomplete files.Problem
Using standard
cpfor large files can result in downstream programs accessing incomplete copies while the copy operation is still in progress. This is particularly problematic in operational weather forecasting where timing and data integrity are critical.Solution
Replaced all instances of
cpto COM directories with:cpfs: For output files being copied TO COM directories (11 instances)cpreq: For required input files being copied FROM COM directories (1 instance)The
cpfsutility provides atomic copies by:This ensures downstream processes never see partially written files.
Changes
Modified 3 files with 12 total changes:
ush/tropcy_relocate.sh (5 changes)
ush/syndat_qctropcy.sh (6 changes)
ush/wave_prnc_ice.sh (1 change)
Testing
cpto COM directoriesImpact
Fixes #3051
Co-authored-by: @DavidHuber-NOAA
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.