Erlend E. Aasland <erlend.aasl...@innova.no> added the comment:

> In production the error was happening after 30 minutes of so.

Great, thanks.

> The major problem is that I don't exactly know how to provoke SQLite to
> acquire an internal lock.

IIRC, you can provoke the internal SQLite lock simply by using transaction 
control: BEGIN (lock) => COMMIT / ROLLBACK (unlock).

> If we assume that it does acquire internal locks and other threads release
> the GIL before calling into SQLite functions that acquire an internal lock,
> then you can reason that if sqlite3_close() acquires that lock without first
> releasing the GIL a deadlock will certainly occur.

True. For the record, I'm not doubting the existence of this deadlock, nor the 
correctness of the proposed solution (allow threads around sqlite3_close()) :)

I'll see if I can come up with a compact repro.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42698>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to