티스토리 뷰
빅데이터/airflow
[airflow] DAG에서 사용하는 멀티 프로세스에서 발생하는 AssertionError: daemonic processes are not allowed to have children
hs_seo 2022. 2. 24. 23:49에어플로우 DAG에서 멀티 프로세스를 이용하는 경우 파이썬 프로세스에서 또 프로세스를 생성할 수 없다는 오류가 발생합니다.
File "/usr/local/lib/python3.8/multiprocessing/process.py", line 118, in start
assert not _current_process._config.get('daemon'), \
AssertionError: daemonic processes are not allowed to have children
해결방법
이 경우 멀티프로세스를 스레드 풀로 변경하면 됩니다. 다음과 같이 사용할 수 있습니다.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from multiprocessing.pool import ThreadPool | |
import os | |
import time | |
def sleepy(x): | |
print("Process Id",os.getpid()) | |
time.sleep(x) | |
return x | |
if __name__ == "__main__": | |
p = ThreadPool(5) | |
pool_output = p.map(sleepy,range(4)) | |
print(pool_output) |
반응형
'빅데이터 > airflow' 카테고리의 다른 글
[airflow] 에어플로우 설정 환경 변수로 설정 (0) | 2022.07.21 |
---|---|
[airflow] Xcom을 이용하여 DAG 간 데이터 전달 (0) | 2022.04.03 |
[airflow] 에어플로우 설치(celery executor + redis) (0) | 2021.12.20 |
[airflow] 에어플로우 DB 초기화 중 Global variable explicit_defaults_for_timestamp needs to be on (1) for mysql 오류 (0) | 2021.11.30 |
[airflow] PythonOperator에서 TypeError: function() got an unexpected keyword argument 'conf' 오류 (0) | 2021.11.25 |
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- Hadoop
- build
- 오류
- oozie
- AWS
- Python
- bash
- airflow
- 백준
- error
- mysql
- 알고리즘
- hbase
- HIVE
- 정올
- ubuntu
- Linux
- SPARK
- SQL
- HDFS
- yarn
- 파이썬
- Tez
- emr
- java
- 하둡
- nodejs
- S3
- 하이브
- 다이나믹
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
글 보관함