[Fix](show-load)Show load npe(userinfo is null) (#27698)

This commit is contained in:
Calvin Kirs
2023-11-28 21:07:32 +08:00
committed by GitHub
parent f54db85ea3
commit c6f43e4241
2 changed files with 9 additions and 4 deletions

View File

@ -826,8 +826,12 @@ public abstract class LoadJob extends AbstractTxnStateChangeCallback implements
jobInfo.add(transactionId);
// error tablets
jobInfo.add(errorTabletsToJson());
// user
jobInfo.add(userInfo.getQualifiedUser());
// user, some load job may not have user info
if (userInfo == null || userInfo.getQualifiedUser() == null) {
jobInfo.add(FeConstants.null_string);
} else {
jobInfo.add(userInfo.getQualifiedUser());
}
// comment
jobInfo.add(comment);
return jobInfo;

View File

@ -572,8 +572,9 @@ public class LoadManager implements Writable {
}
// add load job info
loadJobInfos.add(loadJob.getShowInfo());
} catch (DdlException e) {
continue;
} catch (RuntimeException | DdlException e) {
// ignore this load job
LOG.warn("get load job info failed. job id: {}", loadJob.getId(), e);
}
}
return loadJobInfos;