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

Sravya Tirukkovalur edited comment on SENTRY-1181 at 4/12/16 9:37 PM:
----------------------------------------------------------------------

We are using ScheduledExecutorService = 
Executors.newSingleThreadScheduledExecutor in NN and as per the java [doc 
|https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ScheduledExecutorService.html#scheduleAtFixedRate(java.lang.Runnable,%20long,%20long,%20java.util.concurrent.TimeUnit)]
 " If any execution of this task takes longer than its period, then subsequent 
executions may start late, but will not concurrently execute." Which means 
update processing in NN is in fact happening sequentially by single thread. 


was (Author: sravya):
Actually, as per java [doc 
|https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ScheduledExecutorService.html#scheduleAtFixedRate(java.lang.Runnable,%20long,%20long,%20java.util.concurrent.TimeUnit)]
 " If any execution of this task takes longer than its period, then subsequent 
executions may start late, but will not concurrently execute." So update 
processing in NN actually is happening sequentially by single thread. 

> Lock SentryAuthorizationInfo#processUpdates
> -------------------------------------------
>
>                 Key: SENTRY-1181
>                 URL: https://issues.apache.org/jira/browse/SENTRY-1181
>             Project: Sentry
>          Issue Type: Bug
>          Components: Hdfs Plugin
>    Affects Versions: 1.7.0
>            Reporter: Sravya Tirukkovalur
>            Assignee: Sravya Tirukkovalur
>         Attachments: SENTRY-1181.1.patch, SENTRY-1181.2.patch
>
>
> If processing of update on NN takes more than the cache interval 
> time(default:30 secs), it is possible that two updates will be processed 
> parallely leading to unexpected behavior. We should instead lock the 
> processing of updates so that we ensure they happen sequentially. Also while 
> doing so, we should add a flag to make sure we should never go into stale 
> mode while processing an update.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to