celery/celery — pull request #2347 by sukrit007 (2014-10-31 05:37:00+00:00)
Title: Patch: Task De-Serialization uses correct mongo url

Use url from CELERY_RESULT_BACKEND during un-pickling of AsynResult as only app is passed during the process.

*Explanation*:
During initialization of MongoBackend, url and app object both are passed so it gets initialized as expected. However, during de-serialization of task, only app object is passed. As a result, the default value for host (localhost), port (27017), user and password is used.

*Fix*:
Also try to read url from CELERY_RESULT_BACKEND.

If neither values are set, it will fallback to existing behavior (i.e. try to use values from host, port, user, password in CELERY_MONGODB_BACKEND_SETTINGS.

If url parameter is passed (initialization), it will be used instead.

If url parameter is not passed, and CELERY_RESULT_BACKEND is present in config, CELERY_RESULT_BACKEND will be used.