diff options
| author | 2025-02-24 14:42:53 -0800 | |
|---|---|---|
| committer | 2025-02-27 22:53:53 +0000 | |
| commit | 5f43c29d99e24fce534bd9069f7970a211c71357 (patch) | |
| tree | b7804cafe350ca8c9e058f047401be69df98eef9 /libs/androidfw/FileStream.cpp | |
| parent | bc85e45d67ee6f7a1e20666c5b5dfc6672c71bf7 (diff) | |
Disable WAL checkpoint from the finalizer
If SQLiteConnection.close() is called from the finalizer, disable WAL
checkpoints. WAL checkpoint can be IO intensive and can cause the
finalizer timeout to expire. Three things to note:
1. The finalizer is invoked only if the application has failed to
explicitly close the database, which is, itself, an error. This
change has no effect if the database is explicitly closed.
2. Even though there is no checkpoint, the WAL file remains intact
and no data is lost.
3. The effect of not checkpointing is the same as if the application
had crashed or had been killed. Which happens all the time.
Flag: android.database.sqlite.no_checkpoint_on_finalize
Bug: 397982577
Test: atest
* FrameworksCoreTests:android.database
* CtsDatabaseTestCases
Change-Id: I124b3ebbf2d3378108bee04a294200b198b64299
Diffstat (limited to 'libs/androidfw/FileStream.cpp')
0 files changed, 0 insertions, 0 deletions