Skip to content

Commit

Permalink
fix label npe
Browse files Browse the repository at this point in the history
  • Loading branch information
aiceflower committed Dec 20, 2024
1 parent 7dd46d2 commit 1db5e45
Showing 1 changed file with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,21 @@ import org.apache.linkis.common.log.LogUtils
import org.apache.linkis.common.utils.{Logging, Utils}
import org.apache.linkis.governance.common.conf.GovernanceCommonConf
import org.apache.linkis.governance.common.entity.{ExecutionNodeStatus, NodeExistStatus}
import org.apache.linkis.governance.common.protocol.engineconn.{
RequestEngineStatusBatch,
ResponseEngineStatusBatch
}
import org.apache.linkis.governance.common.protocol.engineconn.{RequestEngineStatusBatch, ResponseEngineStatusBatch}
import org.apache.linkis.governance.common.utils.GovernanceConstant
import org.apache.linkis.manager.common.entity.enumeration.NodeStatus
import org.apache.linkis.manager.common.protocol.node.{RequestNodeStatus, ResponseNodeStatus}
import org.apache.linkis.manager.label.entity.Label
import org.apache.linkis.manager.label.entity.engine.EngineTypeLabel
import org.apache.linkis.manager.label.utils.LabelUtil
import org.apache.linkis.orchestrator.computation.conf.ComputationOrchestratorConf
import org.apache.linkis.orchestrator.computation.execute.{CodeExecTaskExecutor, EngineConnTaskInfo}
import org.apache.linkis.orchestrator.listener.task.{
TaskErrorResponseEvent,
TaskLogEvent,
TaskStatusEvent
}
import org.apache.linkis.orchestrator.listener.task.{TaskErrorResponseEvent, TaskLogEvent, TaskStatusEvent}
import org.apache.linkis.rpc.Sender
import org.apache.linkis.server.{toJavaMap, BDPJettyServerHelper}
import org.apache.linkis.server.{BDPJettyServerHelper, toJavaMap}

import java.util
import java.util.concurrent.TimeUnit

import scala.collection.JavaConverters._
import scala.collection.mutable
import scala.collection.mutable.ArrayBuffer
Expand Down Expand Up @@ -203,7 +196,12 @@ object EngineConnMonitor extends Logging {
val execTask = executor.getExecTask
Utils.tryAndError {
val labels: Array[Label[_]] = executor.getEngineConnExecutor.getLabels()
val engineType: String = LabelUtil.getEngineTypeLabel(labels.toList.asJava).getEngineType
val engineTypeKey = "engineType"
val labelArray: Array[Label[_]] = labels.filter(_.getLabelKey.equals(engineTypeKey))
var engineType = ""
if (labelArray != null && labelArray.size > 0) {
engineType = labelArray(0).asInstanceOf[EngineTypeLabel].getEngineType
}
logger.warn(
s"Will kill task ${execTask.getIDInfo()} because the engine ${executor.getEngineConnExecutor.getServiceInstance.toString} quited unexpectedly."
)
Expand Down

0 comments on commit 1db5e45

Please sign in to comment.