Repository navigation
Correct calculation of application current time with timezone - #4173
georgepsarakis merged 2 commits into
Conversation
|
@rtpg @thedrow @auvipy can you please review this change? It seems that it has many side-effects. See also celery/kombu#774 and probably #4169 . |
|
|
||
| def now(self): | ||
| """Return the current time and date as a datetime.""" | ||
| from celery.utils.time import to_utc |
There was a problem hiding this comment.
why are we importing stuff here?
There was a problem hiding this comment.
No good reason. Fixed in latest commit, thanks.
|
At least for the changes to |
|
Thank you both for the reviews 😄 . |
|
I believe this PR should also close #4145 ? |
|
maybe this is also related #4041 however I think there is still a bug somewhere, but may not be directly related in all issues. please see my comment there with a small explanation |
…son, made timezone aware. Fixes crontab schedules after celery/celery#4173.
|
It seems this commit don't resolve everything : |
…son, made timezone aware. Fixes crontab schedules after celery/celery#4173.
|
hopefully release this pull request as soon as possible. |
|
This PR solve our problems. Please release a fix version for 4.1.x series as soon as possible. |
|
@chuanma This does update some unit tests that cover the calculation of "now". Because of the low-level nature of this bug, higher level tests won't catch this bug (Because ultimately a lot of code relied on this code path for determining the time). When everyone holds the same broken clock, hard to notice that it's broken. Luckily, it also means there's usually just one place to fix |
…#4173) * Use datetime.astimezone to adjust current time * Remove import statements from Celery.now
…#4173) * Use datetime.astimezone to adjust current time * Remove import statements from Celery.now
|
Any chance of a 4.1.1 hotfix release happening? We recently upgraded from v4.0.2 to v4.1, thinking a minor version release from two months ago would have been a safe upgrade. But due to our reliance on |
|
We downgraded to v4.0.2 because of this issue... |
|
Same here, 4.1 series broke our scheduling because our timezone is |
|
Wondering when to release the PR. |
|
hopefully release this pull request as soon as possible. |
|
Bug 修复了吗?
… 在 2017年10月20日,14:35,Josh Yu ***@***.***> 写道:
hopefully release this pull request as soon as possible.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#4173 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AXch3VbArtS8E0rG_OMhJA28YAHIHlA-ks5suD8hgaJpZM4OmLEL>.
|
|
@fanjindong , I thank the PR has fixed it. |
|
@JoshYuJump celery --version At this point in my setting, do not work?? |
|
TIME_ZONE='Asia/Shanghai' celery --version At this point in my setting, do not work?? |
|
兄弟,4.1.0还没有修复这个问题,暂时回退到4.0.2就好了
fanjindong
… 在 2017年10月23日,16:19,wyb ***@***.***> 写道:
TIME_ZONE='Asia/Shanghai'
CELERY_ENABLE_UTC = False
CELERY_TIMEZONE = 'Asia/Shanghai'
CELERYBEAT_SCHEDULE = {
'cc':{
'task':'operate.check_hangqing_sts',
'schedule': crontab(minute="10",hour='14')
}
}
celery --version
4.1.0 (latentcall)
At this point in my setting, do not work??
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
|
Any chance of releasing a new version for this any time soon? |
|
yes version 4.2 is due in January 2018 |
|
that is really a super bug.... |
|
@xycloud celery is a volunteer driven project and relies on the effort of the volunteers like you and me. please help with contributions in any form which is useful. we really lack enough resource to manage this huge project. |
|
yes, thanks celery sincerely, its really a awesomeness. |
|
yes but we had plans for donation but failed to reach our goal. |
…son, made timezone aware. Fixes crontab schedules after celery/celery#4173.
|
It looks like this did not make it into version 4.1.1? |
|
I didn't cherry pick this into 4.1.1. |
…#4173) * Use datetime.astimezone to adjust current time * Remove import statements from Celery.now # Conflicts: # celery/app/base.py
…son, made timezone aware. Fixes crontab schedules after celery/celery#4173.
Description
Incorrect application current time calculation was introduced with https://github.com/celery/celery/pull/3867/files .
datetime.astimezoneto adjust current time inApp.now.Closes #4160 .