Message404177
FYI: We've been using sqlite3_close_v2(), when available, since 2017 (see 86a670543ff97d52fd9b8ca0477f8b6d27ee946d), but we now call it with GIL held.
I'm leaning towards closing this as out-of-date. There is no reproducer, there has been no more similar bug reports, and there has been no activity on this issue.
Possible improvement of connection_close():
1. save database pointer to temporary variable
2. clear self->db
3. call sqlite3_close_v2() (without holding GIL)
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index d6d1fa8bf2..47c0267e89 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -301,9 +301,12 @@ static void
connection_close(pysqlite_Connection *self)
{
if (self->db) {
- int rc = sqlite3_close_v2(self->db);
- assert(rc == SQLITE_OK), (void)rc;
+ sqlite *db = self->db;
self->db = NULL;
+ Py_BEGIN_ALLOW_THREADS
+ int rc = sqlite3_close_v2(db);
+ assert(rc == SQLITE_OK), (void)rc;
+ Py_END_ALLOW_THREADS
}
}
} |
|
Date |
User |
Action |
Args |
2021-10-18 11:40:57 | erlendaasland | set | recipients:
+ erlendaasland, ghaering, serhiy.storchaka, scorp |
2021-10-18 11:40:57 | erlendaasland | set | messageid: <1634557257.84.0.82194400621.issue26387@roundup.psfhosted.org> |
2021-10-18 11:40:57 | erlendaasland | link | issue26387 messages |
2021-10-18 11:40:57 | erlendaasland | create | |
|