0

我用Spark做ETL,偶尔会出现“could not allocate memory”的错误。

这里的问题是即使失败,它也会返回退出代码 0。

我正在使用 Airflow BashOperator,它使用 bash 退出代码作为成功参数。它使提到错误的工作取得了错误的成功。

错误日志如下所示。

[2016-06-22 10:00:54,494] {models.py:974} INFO - Executing <Task(SparkSubmitPythonOperator): ingest_track> on 2016-02-12 01:00:00
[2016-06-22 10:00:54,548] {bash_operator.py:52} INFO - tmp dir root location: 
/tmp
[2016-06-22 10:00:54,548] {bash_operator.py:61} INFO - Temporary script location :/tmp/airflowtmp7gl4hl//tmp/airflowtmp7gl4hl/ingest_track0lEaKC
[2016-06-22 10:00:54,548] {bash_operator.py:62} INFO - Running command: spark-submit.sh --master yarn-cluster --packages com.amazonaws:aws-java-sdk:1.7.4,org.apache.hadoop:hadoop-aws:2.7.1 --num-executors 1 ingest_script.py --dt "2016-02-12 01:00:00" --env prod --task_id ingest_track
[2016-06-22 10:00:54,556] {bash_operator.py:70} INFO - Output:
[2016-06-22 10:00:55,200] {bash_operator.py:74} INFO - Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000771b00000, 82313216, 0) failed; error='Cannot allocate memory' (errno=12)
[2016-06-22 10:00:55,226] {bash_operator.py:77} INFO - Command exited with return code 0

我的问题是,为什么提交过程本身失败时退出代码为 0?如何使它正确?

谢谢!

4

0 回答 0