MI-DPLA / combine

Combine /kämˌbīn/ - Metadata Aggregator Platform
MIT License
26 stars 11 forks source link

Background tasks are DB blocking #200

Closed ghukill closed 5 years ago

ghukill commented 6 years ago

Tried to mitigate with ordering of actions, but deleting an Organization revealed this really isn't an option (as it loops through child Jobs and deletes).

So much so, even got this error form Record Group page, which attempts to update Job statuses:

(1205, 'Lock wait timeout exceeded; try restarting transaction')

It appears to only be when background tasks save model instances. Reading is just fine, but a single save seems to lock up the connection.

Spark doesn't appear to have this problem, potentially because:

There were situations early on, where spark tasks were attempting to use ORM, that it had incomplete or stale data. Believe it was a separate connection than the Django runtime. However, Background Tasks are using the same one.