Closed
Bug 1554316
Opened 5 years ago
Closed 2 months ago
Consider allowing consumers to close kvstore
Categories
(Core :: SQLite and Embedded Database Bindings, enhancement, P3)
Core
SQLite and Embedded Database Bindings
Tracking
()
RESOLVED
DUPLICATE
of bug 1909409
People
(Reporter: nanj, Unassigned)
Details
In certain cases, it'll be desirable for the kvstore consumers to explicitly close the store and its underlying rkv environment.
Note that all the rkv environments are managed by a global manager, we'd like to consider following cases:
- Since
kvstore::KeyValueDatabase
is a tuple of(rkv, store)
, and there could be multiple stores opened on the same rkv environment. The closing can only be performed when all the stores on that rkv have already been closed. - Some kind of protection is required to prevent consumers from using the closed store. Rust lifetime checker would help to enforce that at the compile time, so perhaps some magic in the kvstore.jsm?
Updated•5 years ago
|
Priority: -- → P3
Updated•2 years ago
|
Severity: normal → S3
Comment 1•2 months ago
|
||
Oh hi, this was added in bug 1909409 for the new SQLite backend! 🎉
- Skv's
nsIKeyValueDatabase
has an asyncclose()
method that can close an individual database, and also close the underlying SQLite connection once all its key-value databases have been closed. - The coordinator prevents consumers from using the closed stores.
- Finally, there's a shutdown blocker that prevents new database operations from starting, waits for any outstanding ones to finish, and then closes the underlying connection.
Updated•2 months ago
|
Product: Toolkit → Core
You need to log in
before you can comment on or make changes to this bug.
Description
•