git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: timeout not working in SqlSensor?


Oh boy, you’re right about that. Thanks!

It still runs for a few hours before it times out, but at least it’s not running indefinitely anymore. I’ll take another look at this later.

Thanks again!

Scott
On Dec 20, 2018, 5:00 PM -0800, Maxime Beauchemin <maximebeauchemin@xxxxxxxxx>, wrote:
> I think it's `timeout` not `time_out`.
> https://airflow.apache.org/code.html#basesensoroperator
>
> On Thu, Dec 20, 2018 at 12:12 PM Scott Halgrim
> <scott.halgrim@xxxxxxxxxx.invalid> wrote:
>
> > Does the timeout param work the way I think it should in Airflow 1.8? My
> > query just pokes at the poke interval indefinitely. I want it to timeout
> > after a few hours and fail instead.
> >
> > The code is basically
> >
> > “””
> > task_name = SqlSensor(
> > conn_id='redshift',
> > sql=(
> > """
> > select * from this_table where date=‘2018-12-18'
> > """
> > ),
> > task_id=’task_name',
> > dag=dag,
> > start_date=datetime(2016, 9, 25),
> > poke_interval=20,
> > time_out=45,
> > “”"
> > So after running the query a couple of times I would expect a failure, but
> > that’s not what’s happening, it just keeps querying and querying every 20
> > seconds.
> >
> > Thanks,
> >
> > Scott
> >