This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author erlendaasland
Recipients erlendaasland, hydroflask
Date 2021-08-02.20:24:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1627935852.81.0.413208941466.issue42698@roundup.psfhosted.org>
In-reply-to
Content
> 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.
History
Date User Action Args
2021-08-02 20:24:12erlendaaslandsetrecipients: + erlendaasland, hydroflask
2021-08-02 20:24:12erlendaaslandsetmessageid: <1627935852.81.0.413208941466.issue42698@roundup.psfhosted.org>
2021-08-02 20:24:12erlendaaslandlinkissue42698 messages
2021-08-02 20:24:12erlendaaslandcreate