Skip to content

couchbase lite java listener is thread safe? #82

@NitzDKoder

Description

@NitzDKoder

Hi Folks,

1)CBL DB with lots of data.
2)When async REST request are made to couchbase lite java listener back to back from JavaScript.
3)Could couchbase lite java listener able handle this use case?
4)See that router code has synchronised most of the part.
https://github.com/couchbase/couchbase-lite-java-core/blob/1.4.0/src/main/java/com/couchbase/lite/router/Router.java#L2498

How thread safe is the couchbase lite java listener code.? Is there possibility of deadlock?


Each instance of {@code HttpURLConnection} may be used for one
 * request/response pair. Instances of this class are not thread safe.

@hideki @pasin please share your thoughts..

Randomly we see listener stops responding, below is the last statement then all the requests are stuck in getDatabase and no response.


[08/10 02:31:52.880] [17619] Listener: [REQUEST] (Acme.Utils.ThreadPool(1)-PooledThread: Acme.Serve.Serve$ServeConnection@d69e0c8) GET: https:mydomin:35898/dbdata/_design%2FgetHistory/_view/getHistory?key=%22tel%3A%2B918888800024%22&reduce=false&group=false
[08/10 02:31:52.881] [17619] Listener: authHeader is null
[08/10 02:31:52.882] [17619] Listener: remoteURL() addr=mydomain
[08/10 02:31:52.883] [17619] Database: getDatabase() com.couchbase.lite.Manager@ac06bc6 com.couchbase.lite.Database@5e86787[/data/user/0/com.compny.ui/files/dbdata.cblite2]

PS: detail logs will be shared soon.

Thanks
Nithin

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions