Skip to content

Commit

Permalink
refine
Browse files Browse the repository at this point in the history
  • Loading branch information
turboFei committed Dec 22, 2023
1 parent 43ad0bf commit 6683d9f
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,14 @@ private[kyuubi] class EngineRef(
tryWithLock(discoveryClient) {
// refer the DiscoveryClient::getServerHost implementation
discoveryClient.getServiceNodesInfo(engineSpace, Some(1), silent = true) match {
case Seq(sn) if (sn.host, sn.port) == hostPort =>
val engineNodePath = s"$engineSpace/${sn.nodeName}"
discoveryClient.delete(engineNodePath)
case _ =>
case Seq(sn) =>
if ((sn.host, sn.port) == hostPort) {
info(s"Deleting engine node:$sn")
discoveryClient.delete(s"$engineSpace/${sn.nodeName}")
} else {
warn(s"Engine node:$sn is not matched with host&port[$hostPort]")
}
case _ => warn(s"No engine node found in $engineSpace")
}
}

Expand Down

0 comments on commit 6683d9f

Please sign in to comment.