No description
66784c4628
SQLite2 seems to hold a shared mutex while running the busy handler when waiting for the database file to become available. This makes it impossible to successfully recover from a locked database when the transaction holding the device busy is in the same process on a different connection. As a result the busy hander has to time out and fail in order to make progress. This patch replaces the default busy handler with one that times out immediately. In addition all database accesses have been moved into retry loops that handle the busy error which can occur at any time, not only during begin or commit of a transaction. This assures that no sqlite3 internal mutexes are held while waiting for the database to become available. The database interface had to change slightly to assure that all database manipulations can be replayed and not data is lost. A test has been added that makes sure that the correct error is caught, and another test was added that produces a lot of concurrent database manipulations and would easily trigger database busy errors. Test: keystore2_test Change-Id: I8ce3e3159b2356ace2b9f0ebdf074bbabc6612af |
||
---|---|---|
fsverity_init | ||
identity | ||
keystore | ||
keystore-engine | ||
keystore2 | ||
ondevice-signing | ||
provisioner | ||
.clang-format | ||
.gitignore | ||
Android.bp | ||
METADATA | ||
MODULE_LICENSE_APACHE2 | ||
NOTICE | ||
OWNERS | ||
PREUPLOAD.cfg | ||
rustfmt.toml |