Fix globbing CWD bug and temp file race in Archive task#7
Closed
Copilot wants to merge 2 commits intofeature/arch_cycfrom
Closed
Fix globbing CWD bug and temp file race in Archive task#7Copilot wants to merge 2 commits intofeature/arch_cycfrom
Copilot wants to merge 2 commits intofeature/arch_cycfrom
Conversation
Co-authored-by: RussTreadon-NOAA <26926959+RussTreadon-NOAA@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix relative-path globbing bug in archive task
Fix globbing CWD bug and temp file race in Archive task
Feb 24, 2026
Owner
|
Good changes but outside the scope of this branch. Will close now and possibly revisit later in a different branch. |
This file contains hidden or 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
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.
Description
Two bugs in
ush/python/pygfs/task/archive.py:Relative-path glob resolution —
_process_additional_datasets()converts dataset paths to ROTDIR-relative paths, but_create_fileset()expanded globs against the process CWD, not ROTDIR, causing required files to be falsely reported missing.Temp file concurrency race —
replace_string_from_to_file()(inside_rename_cyclone_expt()) wrote to a hardcoded/tmp/track_filebefore moving it to the destination. Multiple concurrent jobs on the same node would clobber each other's temp file.Fix 1 —
_create_fileset(): glob relative to ROTDIRAdded optional
rotdirparameter; wraps glob expansion inwith chdir(rotdir) if rotdir is not None else contextlib.nullcontext(). Call site in_process_additional_datasets()now passesarch_dict['ROTDIR'].Fix 2 —
replace_string_from_to_file(): unique temp file per invocationReplaced fixed
/tmp/track_filewithtempfile.NamedTemporaryFile(delete=False, dir=os.path.dirname(filename_out))so each concurrent job gets a unique temp file in the destination directory (same filesystem → atomic rename). Addedexceptblock to unlink the temp file on failure.New imports:
contextlib,tempfile.Type of change
Change characteristics
How has this been tested?
Checklist
Original prompt
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.