-
Notifications
You must be signed in to change notification settings - Fork 185
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
tiledb_vfs_open is not reporting error correctly #4347
Conversation
This pull request has been linked to Shortcut Story #33908: |
tiledb/api/c_api/vfs/vfs_api.cc
Outdated
@@ -234,6 +235,7 @@ capi_return_t tiledb_vfs_open( | |||
// Open VFS file | |||
auto st{(*fh)->open()}; | |||
if (!st.ok()) { | |||
save_error(ctx, st); |
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.
This statement should throw rather than manually saving the error. throw_if_not_ok(st)
is sufficient.
We're setting up to change error handling away from storing it on the context and returning it. We'll redefine the symbol capi_return_t
at that point.
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.
Even better would be move the call to open
into the constructor of tiledb_vfs_fh_handle_t
and throw if the open fails. That'll save a try
block and any need to break a handle.
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.
+1
3875ef1
to
6162a9c
Compare
@eric-hughes-tiledb @bekadavis9 @ihnorton
|
Reverted the change in |
It's a good decision. The API design has problem. We shouldn't have a |
Filed https://app.shortcut.com/tiledb-inc/story/33965/tiledb-vfs-close-behavior-is-contradictory-with-regards-to-vfs-docs to track the ideas above. Edit: Also filed https://app.shortcut.com/tiledb-inc/story/33961/refactor-c-api-vfs-test-unit-capi-vfs-so-that-tests-are-independent-of-each-other because I noticed test cases are not independent. |
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.
LGTM.
Final code is much cleaner.
) Save error on the context before returning error code in `tiledb_vfs_open`. --- TYPE: BUG DESC: Save error on the context before returning error code in vfs_open (cherry picked from commit ea25897)
) (#4350) Save error on the context before returning error code in `tiledb_vfs_open`. --- TYPE: BUG DESC: Save error on the context before returning error code in vfs_open (cherry picked from commit ea25897) Co-authored-by: Robert Bindar <[email protected]>
Save error on the context before returning error code.
TYPE: BUG
DESC: Save error on the context before returning error code in vfs_open.