Potential race condition fix?
dgutson opened this issue · comments
I observed this change in @c4p-n1ck's fork:
- self.__conn = sqlite3.connect(db_file)
+ self.__conn = sqlite3.connect(db_file, check_same_thread=False)
Should that be brought here?
Hmmm, just had a quick look.
I think what we could do is adding that check_same_thread
as an config option at here:
montydb/montydb/storage/sqlite.py
Line 237 in 4653538
Then the config should be used to initialize a SQLite storage engine instance here:
montydb/montydb/storage/sqlite.py
Lines 85 to 89 in 4653538
At the moment, SQLite config is being used to keep database pargmas, but it could do more than that. And check_same_thread
is a good fit.
so it is not a race condition fix? Sorry about my ignorance.
Don't be sorry! I am not familiar with this either.
But we certainly can add check_same_thread
as a connection option though. Since it will affect the behavior of how a sqlite connection reacts to different thread, so we would want it to be optionable.
u rock!