yaooqinn commented on a change in pull request #1980:
URL: https://github.com/apache/incubator-kyuubi/pull/1980#discussion_r816383428
##########
File path:
kyuubi-common/src/main/scala/org/apache/kyuubi/service/TFrontendService.scala
##########
@@ -56,22 +56,53 @@ abstract class TFrontendService(name: String)
protected lazy val authFactory: KyuubiAuthenticationFactory =
new KyuubiAuthenticationFactory(conf, isServer())
+ /**
+ * Start the service itself(FE) and its composited (Discovery service, DS)
in the order of:
+ * Start FE ->
+ * if (success) -> Continue starting DS
+ * if (success) -> finish
+ * else -> Stop DS -> Raise Error -> Stop FE -> Raise Error
+ * else
+ * Raise Error -> Stop FE -> Raise Error
+ * This makes sure that the FE has started and ready to serve before
exposing through DS.
+ */
override def start(): Unit = synchronized {
- super.start()
- if (!started.getAndSet(true)) {
- serverThread.start()
+ try {
+ if (started.compareAndSet(false, true)) {
+ serverThread.start()
+ }
+ super.start()
+ } catch {
+ case e: Throwable =>
+ stopInternal()
+ throw e
}
}
protected def stopServer(): Unit
- override def stop(): Unit = synchronized {
- if (started.getAndSet(false)) {
+ /**
+ * Inner stop progress that will not stop all services composited with this.
Review comment:
TTheadExecutor
--
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]