-
Notifications
You must be signed in to change notification settings - Fork 919
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
RESTful API supports killing engine forcibly #6008
Conversation
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/AdminResource.scala
Outdated
Show resolved
Hide resolved
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/AdminResource.scala
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6008 +/- ##
=======================================
Coverage 0.00% 0.00%
=======================================
Files 675 677 +2
Lines 41631 41775 +144
Branches 5687 5707 +20
=======================================
- Misses 41631 41775 +144 ☔ View full report in Codecov by Sentry. |
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/AdminResource.scala
Outdated
Show resolved
Hide resolved
kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/AdminResource.scala
Show resolved
Hide resolved
Done. Thanks |
Done. |
OK. I'm looking into it |
docs/client/rest/rest_api.md
Outdated
| subdomain | the engine subdomain | String(optional) | | ||
| proxyUser | the proxy user to impersonate | String(optional) | | ||
| hive.server2.proxy.user | the proxy user to impersonate | String(optional) | | ||
| kill | whether to kill the engine forcibly | Boolean(optional) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's mention the default value is false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.
StandardCharsets.UTF_8) | ||
mapper.readValue(json, classOf[ApplicationManagerInfo]) | ||
} catch { | ||
case _: Throwable => ApplicationManagerInfo(None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log the original encodedStr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Thanks.
.createWithDefault(Seq("spark.driver.memory", "spark.executor.memory")) | ||
.createWithDefault(Seq( | ||
"spark.driver.memory", | ||
"spark.executor.memory")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format issue. Restored.
|
||
def deserialize(encodedStr: String): ApplicationManagerInfo = { | ||
try { | ||
info(s"The original string encoded:$encodedStr") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to catch block. we only need to print the base64 string when something goes wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Done
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/ApplicationOperation.scala
Outdated
Show resolved
Hide resolved
…ionOperation.scala
kyuubi-server/src/main/scala/org/apache/kyuubi/engine/ApplicationOperation.scala
Outdated
Show resolved
Hide resolved
…ionOperation.scala
kyuubi-server/src/test/scala/org/apache/kyuubi/server/api/v1/AdminResourceSuite.scala
Outdated
Show resolved
Hide resolved
…dminResourceSuite.scala
cc @turboFei, this patch now adopts your suggestions, please take a look when you have time. |
would you update the AdminRestApi and CommandLine? |
Thanks, merged to master |
val engineNodes = discoveryClient.getServiceNodesInfo(engineSpace, silent = true) | ||
engineNodes.foreach { engineNode => | ||
val nodePath = s"$engineSpace/${engineNode.nodeName}" | ||
val engineRefId = engineNode.engineRefId.orNull | ||
info(s"Deleting engine node:$nodePath") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late comment.
the engineSpace
is not cleaned right? Why don't we delete it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
except for CONNECTION level engine, we cannot guarantee that there are no other engines access the same engineSpace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean there can be multiple engines under same subdomain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. Even in GROUP level, we can only create one engine per subdomain, right. And subdomain has been included in engineSpace
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are some corner cases. for example, if the engine has no response due to full GC or overload, kyuubi will create a new one on the same engine space. I also see sometimes the dist lock does not work properly(which should not, may be bugs), that also causes multi engines live in the same subdomain. finally, in theory, there are race conditions for kyuubi server deleting and engine registering under the same subdomain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation!
🔍 Description
Issue References 🔗
Describe Your Solution 🔧
I'd like to introduce the feature that allows users to forcibly kill an engine through API.
Types of changes 🔖
Test Plan 🧪
Behavior Without This Pull Request ⚰️
Behavior With This Pull Request 🎉
Related Unit Tests
Checklist 📝
Be nice. Be informative.