[CELEBORN-1615] Start the http server after all handlers added
### What changes were proposed in this pull request? Start the http server after all handlers added. ### Why are the changes needed? Do not expose the RESTful server before all handlers initialized. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing UT. Closes #2764 from turboFei/metrics_not_found. Authored-by: Wang, Fei <fwang12@ebay.com> Signed-off-by: Shuang <lvshuang.xjs@alibaba-inc.com>
This commit is contained in:
parent
8bd5ac0b99
commit
87822f6fe2
@ -209,7 +209,6 @@ abstract class HttpService extends Service with Logging {
|
||||
httpSslKeyStoreAlgorithm(),
|
||||
httpSslDisallowedProtocols(),
|
||||
httpSslIncludedCipherSuites())
|
||||
httpServer.start()
|
||||
startInternal()
|
||||
// block until the HTTP server is started, otherwise, we may get
|
||||
// the wrong HTTP server port -1
|
||||
@ -348,9 +347,13 @@ abstract class HttpService extends Service with Logging {
|
||||
|
||||
if (metricsSystem.running) {
|
||||
metricsSystem.getServletContextHandlers.foreach { handler =>
|
||||
logInfo(s"Adding metrics servlet handler with path ${handler.getContextPath}")
|
||||
httpServer.addHandler(handler)
|
||||
}
|
||||
}
|
||||
|
||||
// start the http server after all handlers are added
|
||||
httpServer.start()
|
||||
}
|
||||
|
||||
override def initialize(): Unit = {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user