Skip to content
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

"Results backend isn't configured" with Celery DynamoDB backend #3557

Closed
3 tasks done
rjpereira opened this issue Sep 29, 2017 · 7 comments
Closed
3 tasks done

"Results backend isn't configured" with Celery DynamoDB backend #3557

rjpereira opened this issue Sep 29, 2017 · 7 comments

Comments

@rjpereira
Copy link

Make sure these boxes are checked before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if any
  • I have reproduced the issue with at least the latest released version of superset
  • I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

0.20.0 from pypi

Expected results

Successful completion of async query

Actual results

Get "Results backend isn't configured." in UI, no error log on console. Celery processing seems successfull

Steps to reproduce

The following is my Celery configuration on superset_config.py.
All the AWS configuration seems to be working ok:
a) I see the request being deposited on queue
b) I see the worker executing the query and queue becoming empty
c) I see the result of the query being appended to DynamoDB table

class CeleryConfig(object):
    BROKER_URL = 'sqs://'
    BROKER_TRANSPORT_OPTIONS = {
        'region': os.environ.get('AWS_DEFAULT_REGION','eu-west-1')
    }
    CELERY_RESULT_BACKEND = 'dynamodb://@/celery_results?read=5&write=5'
    CELERY_IMPORTS = ('superset.sql_lab', )
    CELERY_ANNOTATIONS = {'tasks.add': {'rate_limit': '10/s'}}

Still after everything seeming to work ok, no error on console, I get "Results backend isn't configured" on UI.

@rjpereira
Copy link
Author

Maybe this is just basic, but just occurred to me now. Is it the case that although Celery "writes" with one backend , Superset use a different "werkzeug" Cache object to retrieve from same location, and therefore I would have to implement a BaseCache derived class to read from DynamoDB myself ?

@mistercrunch
Copy link
Member

The "results backend" is different from the CELERY_RESULT_BACKEND, actually we do not use the CELERY_RESULT_BACKEND.

The results backend is used by the worker to store the query results. At Airbnb we use the S3Cache lib pip install s3werkzeugcache and store the results in S3.

@rjpereira
Copy link
Author

Thanks. I managed to get it working through S3, but I'm actually curious about "actually we do not use the CELERY_RESULT_BACKEND". I understand that you may not use it in Superset, but if I configure it in Celery configuration object, doesn't Celery store anyway its state and results on this backend (even if superset doesn't use it ?) Thx

@mistercrunch
Copy link
Member

It will if the @celery.task-decorated function does return something, which shouldn't be the case in our case.

The way we use celery is we initiate the async task from a web request scope and essentially give up on it. The initiator (web server) doesn't expect getting result in the scope where its called.

@mistercrunch
Copy link
Member

We may or may not use the celery results backend in the future though.

@rjpereira
Copy link
Author

Thanks I made it work in the end, although value is limited, agree.
At the same time did an implementation of a DynamoDb Werkzeug Cache to support Slice and Schema caching (subject to Dynamo 400K limitation). First drop here (https://github.com/logindex/dynamodb-werkzeugcache) if anyone is interested.

@mistercrunch
Copy link
Member

Nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants