New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix celery issues when using flower REST API #3950
Conversation
Flower throws a stack trace and returns HTTP 500 when the /tasks endpoint is being triggered. A defect that manifested after Celery went from v3 to v4. The following change is incorporated celery/celery#3950 To address the following issue: mher/flower#648
Flower throws a stack trace and returns HTTP 500 when the /tasks endpoint is being triggered. A defect that manifested after Celery went from v3 to v4. The following change is incorporated celery/celery#3950 To address the following issue: mher/flower#648
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are failing and there's one thing I need you to change. Please fix the build and the code.
celery/events/state.py
Outdated
@@ -296,7 +296,7 @@ def __init__(self, uuid=None, cluster_state=None, children=None, **kwargs): | |||
self.children = WeakSet( | |||
self.cluster_state.tasks.get(task_id) | |||
for task_id in children or () | |||
if task_id in self.cluster_state.tasks | |||
if self.cluster_state is not None and task_id in self.cluster_state.tasks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it's a better idea to extract the additional condition outside of the comprehension.
Thanx for your feedback @thedrow. |
Thanks. Feel free to add yourself to the AUTHORS file. |
Description
We meet issues when using the "official" flower REST API and "broker" in front of celery.
c.f github.com/mher/flower/issues/648
I've created a Quick & Dirty patch for this.
Could you please review ?
Thanks