Copilot commented on code in PR #7302:
URL: https://github.com/apache/kyuubi/pull/7302#discussion_r2693434422


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/EngineRef.scala:
##########
@@ -367,6 +367,18 @@ private[kyuubi] class EngineRef(
             val msg = s"Deleting engine node:$sn"
             info(msg)
             discoveryClient.delete(s"$engineSpace/${sn.nodeName}")
+
+            if (shareLevel != CONNECTION && builder != null) {
+              try {
+                val appMgrInfo = builder.appMgrInfo()
+                engineManager.killApplication(appMgrInfo, engineRefId, 
Some(appUser))

Review Comment:
   Missing null check for engineManager. The condition should be updated to 
check both builder and engineManager for null before attempting to call 
killApplication. Without this check, a NullPointerException will occur when 
engineManager is null, such as in test scenarios where EngineRef is 
instantiated with a null engineManager parameter.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to