-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Database cuncurrency problem #2782
Comments
Not much to go on but I'll bite. What is the context you are calling |
Thanks kwilcox. Then I am calling luigi.build from a view as a different thread with Celery.
Hope it helps. |
You may want to try abstracting out the |
Hi again, sorry the delay but I was out of office. Therefore is not a problem raised by Celery. |
It seems that Django and Postgres have problem to run queries from different processes Is it possible to spawn workers as threads? |
Database connections are not typically shared over different processes. You'll need to be creating the database connection in the |
While this is an example of Task class:
|
For whom is interested I found a solution. When using multiprocessing in Python, you should close all connection every time a process is spawned. Tehrefore in Luigi inside every Task.
|
@diegocorradini Hi could you please share with me how you set up django and luigi? I am trying to use django-luigi to access Django ORM but keep running into problem of |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If closed, you may revisit when your time allows and reopen! Thank you for your contributions. |
Hello, I am facing a similar issue with Luigi and SQL Alchemy. How can I achieve such "on start worker" engine disposal? I would like to avoid disposing the database engine more than once per worker, hence I do not want to add the dispose instruction on each of my Luigi tasks. Many thanks for the help. |
Hi all,
I am developing a pipeline in Django where different workers read/write on a database.
Everything is working fine if I am using only one worker.
Otherwise I get random errors in the tasks like: pop from empty list, EOF detected, database is locked.. depending on the databaes backend.
Yes because I tried with Postgres, MySQL and SQLite..
This is the line where I am configuring the workers:
luigi.build(Workflow(id=session_id)], workers=4)
Any help would be really appreciate since I am stuck with this problem.
The text was updated successfully, but these errors were encountered: