Skip to content

The connection pool for database 'xxx' has been unable to grant a connection to thread 376 (pool-5-thread-1) with flags 0x2 for 180.01001 seconds #355

Closed
@anthinkingcoder

Description

@anthinkingcoder

Current behavior

setItem not callback

Expected behavior

setItem callback

Repro steps

when excute mReactDatabaseSupplier.get().setTransactionSuccessful();,
I found get() not enter。it‘s block,maybe not get lock

  1. add log
    C7BAAFBD-ED33-499E-9A71-645F17883000
    4415314F-9268-4DD5-BDD6-6422014FF2BA

run it, show the log。mReactDatabaseSupplier.get() not log get lock AsyncTask #1,it‘s block。
84A9EC98-EF01-4DAE-B9EB-BE60C3B1DCFB

  1. use Lock instead of synchronized
    get()
    image
    ensureDatabase()
    image

it's ok。
8F55E933-18AD-431A-933A-D0E803F78BCF

Environment

  • Async Storage version: 1.9.0
  • React-Native version:0.59
  • Platform tested: Android9
  • Logs/Error that are relevant:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions