-
Couldn't load subscription status.
- Fork 2
Race condition fix #86
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
Conversation
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.
Pull Request Overview
This pull request addresses a race condition by ensuring unique holography file names when copied and fixes a hard-coded catalogue name.
- Unique file name generation in linmos.py using a UUID.
- Dynamic assignment of the catalogue name in makecat.py based on the output file.
- Minor import ordering updates in fitsutils.py and frion.py.
- Bumped versions in the pre-commit configuration to align with updated tooling.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| arrakis/utils/fitsutils.py | Reordered FRion import to consolidate dependencies. |
| arrakis/makecat.py | Updated catalogue name assignment based on outfile input. |
| arrakis/linmos.py | Introduced unique filename generation using a UUID for holography files. |
| arrakis/frion.py | Adjusted FRion import ordering for consistency. |
| .pre-commit-config.yaml | Upgraded pre-commit hook revisions and removed the typos hook. |
Comments suppressed due to low confidence (2)
arrakis/linmos.py:210
- [nitpick] Consider using uuid.uuid4() instead of uuid.uuid1() to generate a non-predictable unique file name, which may better address the race condition.
holofile_name = str(uuid.uuid1()) + ".fits"
.pre-commit-config.yaml:36
- [nitpick] The removal of the typos hook might reduce automated spelling checks; please confirm that this removal is intentional.
repo: https://github.com/crate-ci/typos
|
After revisiting with is @tjgalvin, we recalled why we added this in the first place. It turns out that the fundamental issue (hammering a lustre file server) was not actually addressed by moving the holography file. Its weird that I never encountered race conditions in my own usage, but was good at least to bring out this lurking bug. I've decided to remove the offending section. Less code is more code. This also places the responsibility for disk usage and management on the user and environment - not in Arrakis. |
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.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (3)
arrakis/makecat.py:1149
- Assigning catalogue_name to None when outfile is not provided might lead to unexpected behavior if downstream code expects a string. Consider using a default string value instead of None.
catalogue_name = None
arrakis/linmos.py:203
- The removal of the file copying logic may affect downstream code that expects the holography file to be available in MEMDIR. Please verify that holofile remains accessible at its referenced location.
copyfile(holofile, holo_copy)
.pre-commit-config.yaml:36
- The removal of the typos pre-commit hook may reduce automatic detection of typographical errors. Confirm this removal is intentional and that other mechanisms are in place to catch such mistakes.
- rev: v1.29.10
Test to ensure unique name for holography file when copied.
Also fixes hard-coded catalogue name (whoops)