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

Skip to content
Commit e2e90b03 authored by Lee Shombert's avatar Lee Shombert
Browse files

Report long database transactions

This change updates the database "recent operations" log.  There are
two changes:
 1. Explicit transactions are now included as an operation.  Explicit
    transactions may include many SQL operations.  If there are too
    many nested operations, then the transaction-begin event might
    fall off the ring buffer.  Therefore, there is a special operation
    reserved for explicit transactions.

    When the recent operations are dumped, the currently-open
    transaction, if any, is also dumped.  The open transaction may
    have fallen out of the recent-operations buffer, in which case it
    is dumped from an operation variable dedicated to the current
    transaction.

 2. Operations longer than a compile-time default are saved in a
    separate history buffer and are dumped in dumpsys.  The duration
    is chosen to be close to the SqliteDatabaseLockedException
    timeout.

Small changes were made to dumpsys dbinfo to make it simpler to parse.
The unit tests now parse that output and perform rudimentary
validation.  SQLiteDatabase.getConcurrentDatabasePaths() has been
removed.  It was test-only, and the unit tests that needed it have
been rewritten to use dumpsys output.

Manually tested by creating lengthy operations and verifying the
dumpsys output.

Test: atest
 * FrameworksCoreTests:android.database
 * CtsDatabaseTestCases
 * SQLiteDatabasePerfTest

Bug: 309135899

Change-Id: I34f2f26102f129ea21af1ccee5a9e9055296c8b4
parent af64c7cf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment