Skip to content

Conversation

mackenzie-grimes-noaa
Copy link
Contributor

Linear Issue

N/A (hotfix)

Changes

  • Ensure that all parent directories of the target FileBasedLock exist before trying to create a .lock file

Explanation

The previous PR (#104), once used by DAS, was throwing uncaught exceptions:

FileNotFoundError: [Errno 2] No such file or directory: '/local_data/tmp/NBM/CONUS/2025/04/30/NBM_CONUS_20250430210000_20250501130000.grib2.idx.lock'

We failed to consider when FileBasedLock would be used to write data to a directory that didn't yet exist.

Now FileBasedLock will create (but not clean up) any parent directories above the provided filepath, before creating the .lock.

@mackenzie-grimes-noaa mackenzie-grimes-noaa marked this pull request as ready for review April 30, 2025 23:36
@mackenzie-grimes-noaa mackenzie-grimes-noaa merged commit f5bcf9b into main Apr 30, 2025
2 checks passed
@mackenzie-grimes-noaa mackenzie-grimes-noaa deleted the bug/file-based-lock-dirs branch April 30, 2025 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant