Closed randomir closed 1 month ago
sqlite3.threadsafety
in Python 3.9:
“Threads may share the module, but not connections.”
diskcache
claims to be thread-safe and process-safe, but there's this.
Starting with Python 3.11, sqlite3.threadsafety
attribute has been fixed to dynamically (correctly) reflect tread-safety of the underlying sqlite3
C module (a compile-time setting).
By default sqlite3
module is compiled in "serialized mode", meaning that "SQLite can be safely used by multiple threads with no restriction," and in particular:
Threads may share the module, connections and cursors
Given the above, I'll close this issue, and refer users to:
sqlite3.threadsafety
set to 3
/ serialized mode.We can re-open upon reproduction in SQLite serialized mode. (Or open issues on sqlite/diskcache repos).
When accessing regions cache from multiple threads (
dwave.cloud.regions.get_regions
), the following errors have been reported:or