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
Causes app to fail startup on AWS Lambda #384
Comments
Just hit this same issue. Were you able to figure out a resolution @deceze? It seems that Lambda doesn't have /dev/shm and therefore doesn't support multiprocessing.Queue or multiprocessing.Pool. https://aws.amazon.com/blogs/compute/parallel-processing-in-python-with-aws-lambda/ |
@lordkev I did not. I switched to dramatiq and dramatiq-sqs instead. |
Ah, thanks for the reply. I just put a PR in with a really simple fix if
you ever want to check out django-q again.
…On Tue, Jan 21, 2020 at 1:24 AM deceze ***@***.***> wrote:
@lordkev <https://github.com/lordkev> I did not. I switched to dramatiq
and dramatiq-sqs instead.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#384?email_source=notifications&email_token=AAEGDEBHSYDYB42GOSK2U6TQ62PLHA5CNFSM4I3DPEJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJOXZHY#issuecomment-576552095>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEGDEFEOJ7CY3WVNGMUX73Q62PLHANCNFSM4I3DPEJQ>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to use django-q to enqueue tasks to AWS SQS from an AWS Lambda function. Versions involved:
This works fine in a local development environment, but putting it on Lambda using Zappa, the app fails with a somewhat cryptic log:
(Yes, it's somewhat cut off somewhere.)
So,
populate() isn't reentrant
is some generic unhelpful error triggered by Django in case some component fails to initialise, and the following cut-off line points somewhere to themultiprocessing
module. When removingdjango_q
from the list of installed apps, the error goes away.It would seem that django-q is trying to import something from
multiprocessing
that doesn't work on AWS Lambda, which causes the entire thing to fail.I don't know whether
multiprocessing
is strictly required for django-q to send tasks to SQS. If possible this should be decoupled somehow. django-q would be ideal for my use case, as it allows the simple use ofasync_task
in code to enqueue tasks, which can be configured to useorm
locally during development and SQS in production. FYI, when using SQS theqcluster
functionality wouldn't be used, and the SQS queue would be an event source for Lambda workers.The text was updated successfully, but these errors were encountered: