Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
976 views
in Technique[技术] by (71.8m points)

timeout - AirflowTaskTimeout after setting execution_timeout

My Airflow DAG keeps failing on the only task that I have. I declared the execution_timeout as 300 seconds, but it keeps crashing after around 37 seconds. The task consists in scraping a website, without Chromedriver. I'm on Linux, Raspberry PI.

Here is the code:

from datetime import timedelta
import importlib
import sys

from airflow.operators.bash_operator import BashOperator
from airflow.operators.python_operator import PythonOperator
from airflow.utils.dates import days_ago

from airflow import DAG

from lib.jobs import jobs, linkedin_jobs, glassdoor_jobs
from lib import jobs_and_companies

default_args = {
    'owner': 'airflow',
    'depends_on_past': False,
    'email': ['firstname.lastname@live.fr'],
    'email_on_failure': True,
    'retries': 0,
    'execution_timeout': timedelta(hours=24)
}

dag = DAG(
    dag_id='jobs',
    default_args=default_args,
    description='Collecting jobs from boards.',
    concurrency=10,
    schedule_interval=timedelta(hours=24),
    start_date=days_ago(2),
    dagrun_timeout=timedelta(seconds=300),
)

linkedin_jobs_task = PythonOperator(
    task_id='linkedin_jobs',
    python_callable=linkedin_jobs.scrap_jobs(),
    dag=dag,
    start_date=days_ago(2),
    execution_timeout=timedelta(seconds=300),
)

Can you help me?

Thanks

question from:https://stackoverflow.com/questions/66047057/airflowtasktimeout-after-setting-execution-timeout

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

What error are you seeing when the crash occurs? Also, I notice your Python callable is named linkedin_jobs.scrap_jobs(). Is that spelled correctly or is it supposed to be linkedin_jobs.scrape_jobs()?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...