YARN-7375. Possible NPE in RMWebapp when HA is enabled and the active RM fails. Contributed by Chandni Singh.
This commit is contained in:
parent
cd2a1dd063
commit
792388e1c0
|
@ -304,19 +304,19 @@ public class AppInfo {
|
||||||
if (!deSelects.contains(DeSelectType.TIMEOUTS)) {
|
if (!deSelects.contains(DeSelectType.TIMEOUTS)) {
|
||||||
Map<ApplicationTimeoutType, Long> applicationTimeouts =
|
Map<ApplicationTimeoutType, Long> applicationTimeouts =
|
||||||
app.getApplicationTimeouts();
|
app.getApplicationTimeouts();
|
||||||
|
timeouts = new AppTimeoutsInfo();
|
||||||
if (applicationTimeouts.isEmpty()) {
|
if (applicationTimeouts.isEmpty()) {
|
||||||
// If application is not set timeout, lifetime should be sent
|
// If application is not set timeout, lifetime should be sent
|
||||||
// as default with expiryTime=UNLIMITED and remainingTime=-1
|
// as default with expiryTime=UNLIMITED and remainingTime=-1
|
||||||
AppTimeoutInfo timeoutInfo = new AppTimeoutInfo();
|
AppTimeoutInfo timeoutInfo = new AppTimeoutInfo();
|
||||||
timeoutInfo.setTimeoutType(ApplicationTimeoutType.LIFETIME);
|
timeoutInfo.setTimeoutType(ApplicationTimeoutType.LIFETIME);
|
||||||
timeouts = new AppTimeoutsInfo();
|
|
||||||
timeouts.add(timeoutInfo);
|
timeouts.add(timeoutInfo);
|
||||||
} else {
|
} else {
|
||||||
for (Map.Entry<ApplicationTimeoutType, Long> entry : app
|
for (Map.Entry<ApplicationTimeoutType, Long> entry : app
|
||||||
.getApplicationTimeouts().entrySet()) {
|
.getApplicationTimeouts().entrySet()) {
|
||||||
AppTimeoutInfo timeout = new AppTimeoutInfo();
|
AppTimeoutInfo timeout = new AppTimeoutInfo();
|
||||||
timeout.setTimeoutType(entry.getKey());
|
timeout.setTimeoutType(entry.getKey());
|
||||||
long timeoutInMillis = entry.getValue().longValue();
|
long timeoutInMillis = entry.getValue();
|
||||||
timeout.setExpiryTime(Times.formatISO8601(timeoutInMillis));
|
timeout.setExpiryTime(Times.formatISO8601(timeoutInMillis));
|
||||||
if (app.isAppInCompletedStates()) {
|
if (app.isAppInCompletedStates()) {
|
||||||
timeout.setRemainingTime(0);
|
timeout.setRemainingTime(0);
|
||||||
|
|
Loading…
Reference in New Issue