Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LinkisManager] Fix create EneingNode throw NPE #4652

Merged
merged 1 commit into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,14 @@ public EngineNode getEngineNodeInfo(EngineNode engineNode) {

@Override
public EngineNode getEngineNodeInfoByDB(EngineNode engineNode) {
// 1. 从持久化器中获取EngineNode信息,需要获取Task信息和Status信息,方便后面使用
engineNode = nodeManagerPersistence.getEngineNode(engineNode.getServiceInstance());
EngineNode dbEngineNode = nodeManagerPersistence.getEngineNode(engineNode.getServiceInstance());
if (null == dbEngineNode) {
throw new LinkisRetryException(
AMConstant.ENGINE_ERROR_CODE, engineNode + " not exists in db");
}
metricsConverter.fillMetricsToNode(
engineNode, nodeMetricManagerPersistence.getNodeMetrics(engineNode));
return engineNode;
dbEngineNode, nodeMetricManagerPersistence.getNodeMetrics(dbEngineNode));
return dbEngineNode;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,7 @@ private List<Label<?>> fromEMGetEngineLabels(List<Label<?>> emLabels) {
}

private boolean ensuresIdle(EngineNode engineNode, String resourceTicketId) {
EngineNode engineNodeInfo =
LinkisUtils.tryAndWarnMsg(
() -> getEngineNodeManager().getEngineNodeInfoByDB(engineNode),
"Failed to from db get engine node info",
logger);
EngineNode engineNodeInfo = getEngineNodeManager().getEngineNodeInfoByDB(engineNode);
if (null == engineNodeInfo) {
return false;
}
Expand Down Expand Up @@ -422,11 +418,13 @@ public EngineNode ensureECAvailable(
EngineStopRequest stopEngineRequest =
new EngineStopRequest(engineNode.getServiceInstance(), ManagerUtils.getAdminUser());
engineStopService.asyncStopEngine(stopEngineRequest);
if (t instanceof LinkisRetryException) {
throw (LinkisRetryException) t;
}
throw new AMErrorException(
AMConstant.ENGINE_ERROR_CODE,
String.format(
"Waiting for %s(%s) initialization failure , now stop it.",
engineNode, resourceTicketId));
String.format("Waiting for %s(%s) initialization failure", engineNode, resourceTicketId),
t);
}
return engineNode;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ public String toString() {
+ serviceInstance
+ ", status="
+ status
+ ", initErrorMsg='"
+ initErrorMsg
+ ", canRetry="
+ canRetry
+ ")";
Expand Down