sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan P (JIRA)" <>
Subject [jira] [Commented] (SENTRY-1002) PathsUpdate.parsePath(path) will throw an NPE when parsing relative paths
Date Mon, 11 Jan 2016 18:53:40 GMT


Ryan P commented on SENTRY-1002:

1. Yeah the terminology I used may  be a bit misleading there. The idea there was that we
are concerned with URIs as opposed to file system paths. That being said we have a 'relative'
URI in the absence of the scheme given that it acts as our root 'directory'. I can change
the description though that's not really an issue. 

2. Yes I am returning null and this is indeed intentional. This may not be the most elegant
way to handle the situation but I leaned toward the side of consistency on this one. 

Sentry Sync does not support filesystems other than HDFS. Any other file system; file://,S3a://,
etc returns a null path since it is not updatable. Given that Hive is not required to run
on HDFS exclusively it would be silly to assume a default. 

The alternative to silently ignoring the update when the URI is malformed would be to throw
an exception. Given that the current behavior is to just ignore any update requests that aren't
for HDFS it just seemed easier to return null. 

If you would like I can edit the behavior so that it throws a URISyntaxException as opposed
to just ignoring the update. This may put us in a situation where HMS is unable cache async
init is set to false however. Let me know what you think and I can adjust accordingly. 


> PathsUpdate.parsePath(path) will throw an NPE when parsing relative paths
> -------------------------------------------------------------------------
>                 Key: SENTRY-1002
>                 URL:
>             Project: Sentry
>          Issue Type: Bug
>          Components: Sentry
>    Affects Versions: 1.6.0
>            Reporter: Ryan P
>            Assignee: Ryan P
>         Attachments: SENTRY-1002.patch, SENTRY-1002.patch
> There a few edge cases where Paths update may be passed a path which lacks a URI Scheme.

> i.e 
> /user/hive/warehouse 
> In this situation PathsUpdate will throw an uncaught NPE at the Precondition check. 
> Since we only support HDFS anyway I suggest we silently ignore these relative paths.

This message was sent by Atlassian JIRA

View raw message