Skip to content

Commit

Permalink
[KYUUBI apache#6531] Fix SPARK-EngineTab stop/gracefulstop not work
Browse files Browse the repository at this point in the history
# 🔍 Description
## Issue References 🔗

This pull request fixes apache#6531

## Describe Your Solution 🔧

Fix SPARK-EngineTab stop/gracefulstop not work

## Types of changes 🔖

- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪

#### Behavior Without This Pull Request ⚰️

#### Behavior With This Pull Request 🎉

#### Related Unit Tests

---

# Checklist 📝

- [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

**Be nice. Be informative.**

Closes apache#6533 from promising-forever/patch-1.

Closes apache#6531

66be0fd [promising-forever] [KYUUBI apache#6531] Fix SPARK-EngineTab stop/gracefulstop not work

Authored-by: promising-forever <79634622+promising-forever@users.noreply.github.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
  • Loading branch information
promising-forever authored and pan3793 committed Jul 12, 2024
1 parent 53b3911 commit 8e84c2a
Showing 1 changed file with 20 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,24 +105,26 @@ case class EngineTab(
.buildChecked(ui)

if (SPARK_ENGINE_RUNTIME_VERSION >= "4.0") {
attachHandlerMethod.invoke {
val createRedirectHandlerMethod = DynMethods.builder("createRedirectHandler")
.impl(
JettyUtils.getClass,
classOf[String],
classOf[String],
classOf[jakarta.servlet.http.HttpServletRequest => Unit],
classOf[String],
classOf[Set[String]])
.buildChecked(JettyUtils)
val createRedirectHandlerMethod = DynMethods.builder("createRedirectHandler")
.impl(
JettyUtils.getClass,
classOf[String],
classOf[String],
classOf[jakarta.servlet.http.HttpServletRequest => Unit],
classOf[String],
classOf[Set[String]])
.buildChecked(JettyUtils)

attachHandlerMethod.invoke {
val killHandler =
(_: jakarta.servlet.http.HttpServletRequest) => handleKill()
val gracefulKillHandler =
(_: jakarta.servlet.http.HttpServletRequest) => handleGracefulKill()

createRedirectHandlerMethod
.invoke("/kyuubi/stop", "/kyuubi", killHandler, "", Set("GET", "POST"))
}

attachHandlerMethod.invoke {
val gracefulKillHandler =
(_: jakarta.servlet.http.HttpServletRequest) => handleGracefulKill()
createRedirectHandlerMethod
.invoke("/kyuubi/gracefulstop", "/kyuubi", gracefulKillHandler, "", Set("GET", "POST"))
}
Expand All @@ -140,11 +142,14 @@ case class EngineTab(
attachHandlerMethod.invoke {
val killHandler =
(_: javax.servlet.http.HttpServletRequest) => handleKill()
val gracefulKillHandler =
(_: javax.servlet.http.HttpServletRequest) => handleGracefulKill()

createRedirectHandlerMethod
.invoke("/kyuubi/stop", "/kyuubi", killHandler, "", Set("GET", "POST"))
}

attachHandlerMethod.invoke {
val gracefulKillHandler =
(_: javax.servlet.http.HttpServletRequest) => handleGracefulKill()
createRedirectHandlerMethod
.invoke("/kyuubi/gracefulstop", "/kyuubi", gracefulKillHandler, "", Set("GET", "POST"))
}
Expand Down

0 comments on commit 8e84c2a

Please sign in to comment.