Default timeouts changes from Couchbase Lite v1.2.1 to v1.3

Hi there,

I updated my Couchbase Lite from v1.2.1 to 1.3 and the default timeouts for longpoll continuous push- and pull-replication seemed to have changed from 5 minutes to 40 seconds.

Here the source from the couchbase-lite-java-core repo I found while investigating this issue:

public static int DEFAULT_SO_TIMEOUT_SECONDS = 40; // 40 sec (previously it was 5 min)
     // heartbeat value 30sec + 10 sec 

What are the reasons for this change? Should I expect a higher serverload at the nginx proxy/sync-gateway?

Anyways, thank your for your awesome project!

Which platform is this? (It can be hard to tell the difference between Java and C# from a one-line sample.) Sorry! Didn’t notice you mentioned the name of the repo.

@hideki, can you please respond?

1 Like

Hi @vaderfone,

What are the reasons for this change?

Java library can not detect all kinds of connection problems. For example, server side has a issue, and socket is incorrectly closed at the server side. Exception is not thrown at client side. CBL client keeps waiting response from server till connection timed-out. This makes bad user experience as it looks like replication is not working or app is hangging. To detect the connection problems earlier, CBL Java/Andnroid uses 40 sec for connection timeout.

Should I expect a higher serverload at the nginx proxy/sync-gateway?

Heart-beat, few bytes of data, is sent from the server to the client every 30 sec instead of 300 sec. I believe this should not cause higher server load.

These values are default value. You can modify it.

Thanks,
Hideki

1 Like