-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
GH-44286: [C++][FS][Azure] Improve error handling #44287
base: main
Are you sure you want to change the base?
Conversation
Thanks for opening a pull request! If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project. Then could you also rename the pull request title in the following format?
or
In the case of PARQUET issues on JIRA the title also supports:
See also: |
hi @kou , here is followup from #44274 . From the PoC, I have tweaked the code changes:
I think this makes somewhat more sense compared to what was in the PoC. What is outstanding are the tests. I have not run the existing tests locally because i don't know how / need to read up on that in the docs (i have build working and is green). Once i get that going, i will add a couple of new tests - any suggestions from your side? |
|
i also went through the FS implementation, looking for any methods that may be using azure client's methods that can lead to exceptions and are outside of try-catch. have not discovered any gaps. |
Here are generic developer documents:
FYI: You can build and run only Azure FS tests by the following command line (note that I use ninja -C cpp.build debug/arrow-azurefs-test && LD_LIBRARY_PATH=$PWD/cpp.build/debug cpp.build/debug/arrow-azurefs-test |
New tests should cover at least |
cpp/src/arrow/filesystem/azurefs.cc
Outdated
template <typename... PrefixArgs> | ||
Status ExceptionToStatus(const std::exception_ptr& ex_ptr, PrefixArgs&&... prefix_args) { | ||
try { | ||
if (ex_ptr) { |
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.
Do we need this?
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.
fixed
cpp/src/arrow/filesystem/azurefs.cc
Outdated
return Status::UnknownError( | ||
std::forward<PrefixArgs>(prefix_args)..., | ||
" An unexpected exception has occurred. No further detail is available."); |
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.
Can we move this to the last catch (...) {...}
block?
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.
fixed
hi @kou , sorry for delays on my end - i had other engagements. i started looking into the extra tests yesterday. Turns out i had build of tests already setup from before and just had to find how to run them :) Thanks for the pointers. I will look into the C++ tests as you suggested - hopefully tomorrow if time allows. So far, I have tried and added a test to PyArrow; dumb part is it takes about 20secs to run because of the underlying timeouts/retries or whatever Azure SDK does before it raises TransportError. I can keep it or drop it - let me know. |
No problem. Thanks for working on this. Sorry, I missed one part for testing. |
Rationale for this change
The AzureFileSystem implementation does not catch all the possible exceptions that may be thrown by the Azure SDK - the code only catches StorageException, while there may be other reasons for the calls to fail. Most notably, Azure SDK communicates network-related errors via a TransportException.
Since the implementation does not capture these exceptions, the caller code has to do that otherwise these uncaught exceptions will cause process to abort.
What changes are included in this PR?
std::exception_ptr
to Arrow Statuscatch (StorageException)
statements which merely convert the exc to status now becomecatch (...)
and call out to the error converter and pass the current exception ptrcatch (StorageException)
statements which also inspect & act on the information included in the exception are left as is. An additionalcatch (...)
is added, calls to converter and passes the current exception ptr.Are these changes tested?
TODO: need extra tests
Are there any user-facing changes?
No