You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sentry.apache.org by "Vamsee Yarlagadda (JIRA)" <ji...@apache.org> on 2017/02/16 21:09:50 UTC

[jira] [Commented] (SENTRY-1628) In HMSFollower failing of catching error causes the executor to halt

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

Vamsee Yarlagadda commented on SENTRY-1628:
-------------------------------------------

Thanks for catching this.

Some references to this problem:
http://stackoverflow.com/questions/6894595/scheduledexecutorservice-exception-handling
https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ScheduledThreadPoolExecutor.html#scheduleWithFixedDelay(java.lang.Runnable,%20long,%20long,%20java.util.concurrent.TimeUnit)

{quote}
Description copied from interface: ScheduledExecutorService
Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given delay between the termination of one execution and the commencement of the next. If any execution of the task encounters an exception, subsequent executions are suppressed. Otherwise, the task will only terminate via cancellation or termination of the executor.
{quote}

It looks like we have to catch all the exceptions at the end and simply continue unless they are critical enough to stop. 


> In HMSFollower failing of catching error causes the executor to halt
> --------------------------------------------------------------------
>
>                 Key: SENTRY-1628
>                 URL: https://issues.apache.org/jira/browse/SENTRY-1628
>             Project: Sentry
>          Issue Type: Sub-task
>          Components: Hdfs Plugin
>    Affects Versions: sentry-ha-redesign
>            Reporter: Hao Hao
>            Assignee: Hao Hao
>             Fix For: sentry-ha-redesign
>
>
> HMSFollower use {{ScheduledExecutorService}} to schedule the notification processing periodically. However, failing to catch error if been thrown reaching the executor would cause the executor to halt. 
> One way to fix this is to catch any exception and errors in the runnable.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)