Closed rgaudin closed 1 year ago
It seems a bit weird because everything was working fine until around the book ID 68890, meaning that lots of stuff has already been done successfully.
Looking at SQLITE documentation, it looks like since we are in WAL mode, SQLITE_BUSY error should never happen. Except that they might happen sometimes. See https://www.sqlite.org/wal.html#sometimes_queries_return_sqlite_busy_in_wal_mode
Since we are not managing this condition at all today + it is documented that it might happen under some rare condition (which we meet from my point of view due to the multiprocessing which is opening / closing DB connection for each book) + it happens very rarely (only once every 50000 books, more or less), I would suggest to first try to fix this issue with a simple constant backoff (i.e. if an apsw.BusyError happens, just retry, we might be in a corner case).
Does it makes any sense from your experience?
@benoit74, latest run encountered a new DB lock situation. Could you take a look?