[ 
https://issues.apache.org/jira/browse/KYLIN-5245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17598205#comment-17598205
 ] 

zhaoliu commented on KYLIN-5245:
--------------------------------


{code:java}
object JobWorkSpace extends Logging {
  def execute(args: Array[String]): Unit = {
    try {
      val (application, appArgs) = resolveArgs(args)
      val eventLoop = new KylinJobEventLoop
      val worker = new JobWorker(application, appArgs, eventLoop)
      val monitor = new JobMonitor(eventLoop)
      val workspace = new JobWorkSpace(eventLoop, monitor, worker)
      if (System.getProperty("spark.master").equals("yarn") && 
System.getProperty("spark.submit.deployMode").equals("cluster")) {
        workspace.run()
      } else {
        System.exit(workspace.run())
      }
    } catch {
      case throwable: Throwable =>
        logError("Error occurred when init job workspace.", throwable)
        System.exit(1)
    }
  }

public class SparkEntry {
    public static void main(String[] args) {
        JobWorkSpace.execute(args);
    }
}

  def run(): Int = {
    eventLoop.start()
    eventLoop.post(RunJob())
    latch.await()
    statusCode
  }

  def success(): Unit = {
    try {
      stop()
    } finally {
      statusCode = 0
      latch.countDown()
    }
  }

  def fail(jf: JobFailed): Unit = {
    try {
      logError(s"Job failed eventually. Reason: ${jf.reason}", jf.throwable)
      KylinBuildEnv.get().buildJobInfos.recordJobRetryInfos(RetryInfo(new 
util.HashMap, jf.throwable))
      stop()
    } finally {
      statusCode = 1
      latch.countDown()
    }
  }
{code}

spark.master=yarn,spark.submit.deployMode=cluster,即使有异常SparkEntry也是正常结束,process 
退出码为0,导致kyin错误判断 job 状态

> When a job is submitted with deployMode=client and the application driver is 
> abnormal, Kylin displays the job status as success
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: KYLIN-5245
>                 URL: https://issues.apache.org/jira/browse/KYLIN-5245
>             Project: Kylin
>          Issue Type: Bug
>          Components: Job Engine
>    Affects Versions: v4.0.1
>            Reporter: zhaoliu
>            Priority: Major
>         Attachments: image-2022-08-31-14-34-56-081.png
>
>
>  !image-2022-08-31-14-34-56-081.png! 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to