You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tez.apache.org by "Johannes Zillmann (JIRA)" <ji...@apache.org> on 2014/07/29 08:16:38 UTC
[jira] [Updated] (TEZ-1278) TezClient#waitTillReady() should not
swallow interrupts
[ https://issues.apache.org/jira/browse/TEZ-1278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johannes Zillmann updated TEZ-1278:
-----------------------------------
Attachment: TEZ-1278.1.patch
> 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
> 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)