-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Remove statuses from ls_with_sizes
and do not mask failures on POSIX.
#5043
Conversation
It was not done in HDFS to minimize risk.
Specifying UTF-8 encoding when opening the files prevents an error on Windows.
ls_with_sizes
and do not mask failures on POSIX.ls_with_sizes
and do not mask failures on POSIX.
tiledb/sm/filesystem/posix.cc
Outdated
@@ -58,6 +58,18 @@ using filesystem::directory_entry; | |||
|
|||
namespace tiledb::sm { | |||
|
|||
struct UniqueDIRDeleter { |
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.
Shouldn't we just wrap DIR in a class here?
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.
We could, but the implementation would be quite more complex. By extending unique_ptr
we take advantage of its RAII capabilities, while reducing complexity and code changes.
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.
You are using a deleter to implement a close method. It's confusing. The class to do this will not be complex at all.
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.
I have seen this pattern in other projects, and we are doing similar stuff in the C++ API but sure, I changed it to a dedicated class.
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.
Are you talking about the one in curl?
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.
Yes, and also in the zstd compressor. Turns out I was wrong about the C++ API, we are using shared_ptr
instead of unique_ptr
there.
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 curl code is 5 years old... The ZSTD context one is a free function, which makes more sense as a deleter.
SC-23179
SC-48851
SC-48854
This PR updates the signature of
ls_with_sizes
in theVFS
class and the specific VFS implementations1 to indicate errors by throwing exceptions instead of returningStatus
.On top of that,
Posix::ls_with_sizes
was updated to fail ifopendir
failed with an error code other thanENOENT
(see also #5037 (comment)).Also in
Posix::ls_with_sizes
, the pointer returned byopendir
was updated to be placed inside a smart pointer, making sure it gets freed. This caused errors in thefind_head_api_violations.py
script, which were fixed.TYPE: BUG
DESC: Do not mask failures when listing a directory fails on POSIX.
Footnotes
HDFS was not updated to minimize risk. ↩