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/15 11:39:05 UTC
[jira] [Created] (TEZ-1278) TezClient#waitTillReady() should not
swallow interrupts
Johannes Zillmann created TEZ-1278:
--------------------------------------
Summary: 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
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)