Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 5f43c29d authored by Lee Shombert's avatar Lee Shombert Committed by Rex Hoffman
Browse files

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
parent bc85e45d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment