to run my flow using multiprocessing, and in one of my tasks I'm connecting to a db and also making sure the connection is closed when the task is done.
I thought that the fact that each process can be allowed to have it's own connection getting the following error:
ProgrammingError: (sqlite3.ProgrammingError) SQLite objects created in a thread can only be used in that same thread
Do I need to add maybe additional kwargs to
DaskTaskRunner()
?
r
Romain Vincent
07/02/2024, 3:23 PM
You need to set up a Postgresql as log database to use parallel tasks in Prefect. The default sqlite does not accept concurrent connections.
a
aviv
07/02/2024, 3:27 PM
It actually worked perfectly in prefect 1 so I thought maybe it’s just a configuration thing when setting up dask
Also I’m using dask to run in parallel not concurrently so it shouldn’t happen
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.