This is an automated email from the ASF dual-hosted git repository.

rexxiong pushed a commit to branch branch-0.5
in repository https://gitbox.apache.org/repos/asf/celeborn.git


The following commit(s) were added to refs/heads/branch-0.5 by this push:
     new 5ebd1e260 [CELEBORN-1615] Start the http server after all handlers 
added
5ebd1e260 is described below

commit 5ebd1e260d20ca310a8d3f684bc98b7485bb5837
Author: Wang, Fei <[email protected]>
AuthorDate: Wed Oct 9 11:35:49 2024 +0800

    [CELEBORN-1615] Start the http server after all handlers added
    
    Start the http server after all handlers added.
    
    Do not expose the RESTful server before all handlers initialized.
    
    No.
    
    Existing UT.
    
    Closes #2764 from turboFei/metrics_not_found.
    
    Authored-by: Wang, Fei <[email protected]>
    Signed-off-by: Shuang <[email protected]>
    (cherry picked from commit 87822f6fe24d2bc9fe0cb1b26e1ba96889cda250)
    Signed-off-by: Shuang <[email protected]>
---
 .../main/scala/org/apache/celeborn/server/common/HttpService.scala   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/service/src/main/scala/org/apache/celeborn/server/common/HttpService.scala 
b/service/src/main/scala/org/apache/celeborn/server/common/HttpService.scala
index a41c18466..5e7be5af2 100644
--- a/service/src/main/scala/org/apache/celeborn/server/common/HttpService.scala
+++ b/service/src/main/scala/org/apache/celeborn/server/common/HttpService.scala
@@ -189,7 +189,6 @@ abstract class HttpService extends Service with Logging {
       httpMaxWorkerThreads(),
       httpStopTimeout(),
       httpIdleTimeout())
-    httpServer.start()
     startInternal()
     // block until the HTTP server is started, otherwise, we may get
     // the wrong HTTP server port -1
@@ -256,9 +255,13 @@ abstract class HttpService extends Service with Logging {
     httpServer.addRedirectHandler("/docs", "/swagger")
     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 = {

Reply via email to