Time out setting for android CBL

Hi All,

When the application starts one shot it goes and brings all document ids and revision numbers. Then a chunk of 100 docs are asked from android to sync gateway and processed in android.

Its all fine. But in what time the first call of one shot should finish so that time out exception doesn’t occur in CBL puller.

Is it 40 seconds by default? If yes then how it can be increased with using options in android ?

Regards
Pankaj Sharma

The replication doesn’t have a timeout, but each HTTP request it makes does. @hideki would know what that timeout is…

Hi @pankaj.sharma,

This is not an ideal solution. But you could experiment with different timeout value for a socket read operation. DEFAULT_READ_TIMEOUT of CouchbaseLiteHttpClientFactory.

thanks @hideki and @jens but is there a get or set property by which it can be increased ? Because we dont want to change the core code and then build it and use in the App.

If was 5 mins in 1.2.1 and now it is 40 seconds. Was there some specific issue due to which this has been reduced ?

Secondly what will be the Time out in 2.0. We are looking forward to 2.0 and if we can resolve this in 2.0, it will be great.

CBL 1.x does not provide setter methods for this. Some of the users already change the value in their app. So we could not change them to final and/or private. The application directly set CouchbaseLiteHttpClientFactory.DEFAULT_SO_TIMEOUT_SECONDS = <any value>; before initializing the database.

If was 5 mins in 1.2.1 and now it is 40 seconds. Was there some specific issue due to which this has been reduced ?

We changed this value to 40sec because CBL library could not detect connection failure till timeout occurs if a server has an unexpected crash or unexpected connection failure occurs between client and server.

Note: I am wondering if CBL receives heart-beat from Sync Gateway every 30 sec. If CBL receives heart-beat correctly, the timeout should not occur.

Its not an issue with the heart beat. I am more concerned with the one shot where it gets 50k document ids and rev number. What if this number increases to 100k or more. That is where I think the issue it.

Secondly with a 16 GB Ram and and 8 core machine the Sync Gateway is taking above 80% of CPU. Even when the connections are very low. Can this be an issue ?

You mentioned this is the one-shot replication issue in the previous comment.

Regarding Sync Gateway, Sync Gateway specialist can advise you.