[ 
https://issues.apache.org/jira/browse/IMPALA-13371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17881274#comment-17881274
 ] 

ASF subversion and git services commented on IMPALA-13371:
----------------------------------------------------------

Commit 30ccfce590903ab64af1ca10b9d42fe3f665aac3 in impala's branch 
refs/heads/master from Csaba Ringhofer
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=30ccfce59 ]

IMPALA-13371: Avoid throwing exception in FindFileInPath()

Some boost::filesystem:: functions can throw exceptions, which led to
crash without informative error when FileSystemUtil::FindFileInPath()
bumped into a problematic path in JavaAddJammAgent().
Fixed by switching to overloads of the functions that can't throw
exception (other functions in FileSystemUtil already used these).

Testing:
- Added tests with paths where Impala has no permissions (/root)

Change-Id: I6ed9f288ac5c400778a6b1215e16baf191bf5d0c
Reviewed-on: http://gerrit.cloudera.org:8080/21778
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>


> Avoid throwing exceptions in FileSystemUtil::FindFileInPath()
> -------------------------------------------------------------
>
>                 Key: IMPALA-13371
>                 URL: https://issues.apache.org/jira/browse/IMPALA-13371
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Backend
>            Reporter: Csaba Ringhofer
>            Assignee: Csaba Ringhofer
>            Priority: Critical
>
> Some function in std::filesystem can throw exceptions in some scenarios. We 
> should catch the exception in all cases or use and overload with noexcept. 
> Even if the error is fatal throwing and exception can lead to not logging it 
> properly.
> An example is filesystem:exists(): 
> https://github.com/apache/impala/blob/22723d0f276468a25553f007dc65b21d79bd821d/be/src/util/filesystem-util.cc#L271
> Other functions use an overload with noexcept:
> https://github.com/apache/impala/blob/22723d0f276468a25553f007dc65b21d79bd821d/be/src/util/filesystem-util.cc#L75
> https://en.cppreference.com/w/cpp/filesystem/exists



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to