You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celeborn.apache.org by zh...@apache.org on 2023/09/09 09:40:22 UTC

[incubator-celeborn] branch main updated: [CELEBORN-961] Catch exception when constructing Worker

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

zhouky pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git


The following commit(s) were added to refs/heads/main by this push:
     new 163dc8d5b [CELEBORN-961] Catch exception when constructing Worker
163dc8d5b is described below

commit 163dc8d5b8f8993f90c4714008aa9496ac505cc6
Author: jiang13021 <ji...@antgroup.com>
AuthorDate: Sat Sep 9 17:40:13 2023 +0800

    [CELEBORN-961] Catch exception when constructing Worker
    
    ### What changes were proposed in this pull request?
    Move the constructor of Worker into a try-catch block.
    
    ### Why are the changes needed?
    There are some exceptions thrown from Worker's constructor instead of Worker.initialize(), so it is necessary to catch these exceptions.
    
    ### Does this PR introduce _any_ user-facing change?
    No
    
    ### How was this patch tested?
    Start a worker with conf
    ```
    celeborn.worker.directMemoryRatioToPauseReceive=0.7
    celeborn.worker.directMemoryRatioToResume=0.7
    ```
    an IllegalArgumentException will be caught
    
    Closes #1894 from jiang13021/celenorn-961.
    
    Authored-by: jiang13021 <ji...@antgroup.com>
    Signed-off-by: zky.zhoukeyong <zk...@alibaba-inc.com>
---
 .../main/scala/org/apache/celeborn/service/deploy/worker/Worker.scala   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/worker/src/main/scala/org/apache/celeborn/service/deploy/worker/Worker.scala b/worker/src/main/scala/org/apache/celeborn/service/deploy/worker/Worker.scala
index 143b54850..597fc9e5b 100644
--- a/worker/src/main/scala/org/apache/celeborn/service/deploy/worker/Worker.scala
+++ b/worker/src/main/scala/org/apache/celeborn/service/deploy/worker/Worker.scala
@@ -727,8 +727,8 @@ private[deploy] object Worker extends Logging {
       conf.set(MASTER_ENDPOINTS.key, RpcAddress.fromCelebornURL(master).hostPort)
     }
 
-    val worker = new Worker(conf, workerArgs)
     try {
+      val worker = new Worker(conf, workerArgs)
       worker.initialize()
     } catch {
       case e: Throwable =>