Skip to content

To check if parent dir exists, use /namespace call instead of /tape/locality#106

Merged
hailihu merged 4 commits intomasterfrom
105-creating-subdirs-recursively-fails-when-parent-does-not-exist-yet
Sep 2, 2025
Merged

To check if parent dir exists, use /namespace call instead of /tape/locality#106
hailihu merged 4 commits intomasterfrom
105-creating-subdirs-recursively-fails-when-parent-does-not-exist-yet

Conversation

@onnozweers
Copy link
Contributor

@onnozweers onnozweers commented Aug 8, 2025

Fixes #105

@onnozweers onnozweers requested a review from hailihu August 8, 2025 15:05
@onnozweers onnozweers linked an issue Aug 8, 2025 that may be closed by this pull request
@onnozweers onnozweers changed the title To check if parent dir exists, use /namespace call instead of /tape/l… To check if parent dir exists, use /namespace call instead of /tape/locality Aug 8, 2025
* New function is_dir() interfered with the output of create_path()
* Typo was fixed in ada but should be fixed in unit test as well, to match
Copy link
Contributor

@hailihu hailihu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to remove the function get_locality entirely then, and replace it by is_dir. This concerns line 1438 in function bulk_request.

* The function used the /tape API call to check whether an object existed. This is not the best call to do that; the namespace call is better for that. Also, there has been a recent change in dCache that affects how this API call works, breaking Ada.
* The last remaining call to this function was not really necessary, because the `case` statement below it already catches the case where a path does not exist.
* Not using `is_dir` because the path might be a file... `is_dir` only returns true for a directory.
Copy link
Contributor

@hailihu hailihu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Only thing is that the integration test still uses get_locatiy in test_ada_mkdir. This should be replaced with is_dir as well. I can make a commit for this and will then merge.

@hailihu hailihu merged commit d710e34 into master Sep 2, 2025
1 check passed
@hailihu hailihu deleted the 105-creating-subdirs-recursively-fails-when-parent-does-not-exist-yet branch September 9, 2025 09:52
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.

Creating subdirs recursively fails, when parent does not exist yet

2 participants