You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified that the issue exists against the master branch of Celery.
Steps to reproduce
Using celery master, call a task that will be 'retried'.
Observe the eta in celery -A app inspect scheduled
Set CELERY_ENABLE_UTC to True and CELERY_TIMEZONE to America/Phoenix
Expected behavior
-> <My Node Name>: OK
* {'priority': 6, 'eta': '2017-07-19T17:02:33.164276-07:00', 'request': {'args': ...
<Task retries @ ETA time>
Actual behavior
-> <My Node Name>: OK
* {'priority': 6, 'eta': '2017-07-19T17:02:33.164276-07:28', 'request': {'args': ...
<Task never retries. Retry count stays at one and the task hangs around indefinitely.>
@georgepsarakis disabling UTC did not solve my problem. After looking into the fix you mentioned above, i dropped in an rdb line to see what was happening.. Here are my results:
> /opt/env/atmo_zz2/src/celery/celery/app/amqp.py(326)as_task_v2()
-> eta = maybe_make_aware(
(Pdb) n
> /opt/env/atmo_zz2/src/celery/celery/app/amqp.py(327)as_task_v2()
-> now + timedelta(seconds=countdown), tz=timezone,
(Pdb)
> /opt/env/atmo_zz2/src/celery/celery/app/amqp.py(329)as_task_v2()
-> if isinstance(expires, numbers.Real):
(Pdb) eta
datetime.datetime(2017, 7, 19, 19, 38, 31, 324450, tzinfo=<DstTzInfo 'America/Phoenix' LMT-1 day, 16:32:00 STD>)
(Pdb) timezone
<DstTzInfo 'America/Phoenix' LMT-1 day, 16:32:00 STD> # NOTE: This is wrong!
(Pdb) print timezone
America/Phoenix
(Pdb) type(timezone)
<class 'pytz.tzfile.America/Phoenix'>
(Pdb) n
> /opt/env/atmo_zz2/src/celery/celery/app/amqp.py(336)as_task_v2()
-> eta = eta and eta.isoformat()
(Pdb) n
> /opt/env/atmo_zz2/src/celery/celery/app/amqp.py(338)as_task_v2()
-> if not isinstance(expires, string_t):
(Pdb) p eta
'2017-07-19T...-07:28'
(Pdb) p countdown
64
Activity
steve-gregory commentedon Jul 19, 2017
Notes:
-07:53).Etc/UTCgeorgepsarakis commentedon Jul 19, 2017
Have you perhaps noticed if it is only a representation issue or the ETA is actually incorrect?
steve-gregory commentedon Jul 19, 2017
@georgepsarakis (Just updated my description to reflect this) The ETA is actually incorrect and prevents the task from being executed.
georgepsarakis commentedon Jul 19, 2017
There was a fix recently for ETA in #3753 , but perhaps this is unrelated.
georgepsarakis commentedon Jul 19, 2017
Can you try with
CELERY_ENABLE_UTC=False? In the issue that I mentioned, the correct way to respect the timezone setting was to also disable UTC.steve-gregory commentedon Jul 19, 2017
@georgepsarakis disabling UTC did not solve my problem. After looking into the fix you mentioned above, i dropped in an
rdbline to see what was happening.. Here are my results:Remove celery@master until celery/celery#4145 is resolved
thedrow commentedon Jul 29, 2017
Can you please verify that this is fixed with master?
steve-gregory commentedon Aug 4, 2017
Confirmed, fixed on master.
jarshwah commentedon Nov 28, 2017
Is there a release planned any time soon with this fix? I'm looking at rolling back to 4.0 to avoid this problem.
Using UTC fixes the eta problems, but the beat schedule is way off in return.
thedrow commentedon Nov 28, 2017
Yes, soon. But we want to merge a few things first.
jarshwah commentedon Nov 28, 2017
No worries, thanks for the heads up.