[ 
https://issues.apache.org/jira/browse/TEZ-1278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Siddharth Seth updated TEZ-1278:
--------------------------------

    Assignee: Johannes Zillmann

> TezClient#waitTillReady() should not swallow interrupts
> -------------------------------------------------------
>
>                 Key: TEZ-1278
>                 URL: https://issues.apache.org/jira/browse/TEZ-1278
>             Project: Apache Tez
>          Issue Type: Improvement
>    Affects Versions: 0.5.0
>            Reporter: Johannes Zillmann
>            Assignee: Johannes Zillmann
>            Priority: Blocker
>         Attachments: TEZ-1278.1.patch
>
>
> Current code is:
> {code}
>   while (true) {
>       TezAppMasterStatus status = getAppMasterStatus();
>       if (status.equals(TezAppMasterStatus.SHUTDOWN)) {
>         throw new SessionNotRunning("TezSession has already shutdown");
>       }
>       if (status.equals(TezAppMasterStatus.READY)) {
>         return;
>       }
>       try {
>         Thread.sleep(SLEEP_FOR_READY);
>       } catch (InterruptedException e) {
>         LOG.info("Sleep interrupted", e);
>         continue;
>       }
>     }
> {code}
> That way you never can stop the wait call since all interrupts are caught and 
> the wait logic just happily proceeds.
> *Suggestion*: InterruptedException could be part of the method signature so 
> the caller can handle this in a way which is adequate to the context.
> Nice read on handling interrupts: 
> http://www.ibm.com/developerworks/library/j-jtp05236/



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to