Join GitHub today
2.0 replication doesn't notify clients when unable to send rev message #3738
During pull replication, the following sequence of messages is expected:
In the scenario that Sync Gateway is unable to perform step 3 (most commonly because the revision body is no longer available), it responds by not sending any rev message at all.
Couchbase Lite is currently monitoring replication status by comparing the number of revisions requested in step 2 with the number of rev messages received in step 3. In the event that Sync Gateway fails to send a rev message, replication becomes stuck in a busy state on the client.
There are at least two expected scenarios where SG is known to be unable to send a rev, that shouldn't terminate replication:
For expected cases, Sync Gateway could send an rev message with a new
This doesn't address how to handle unexpected errors (that replication should eventually retry). I don't know of a mechanism that Lite could do this, other than stopping the entire replication and restarting with the previous since value. Before triggering that, should Sync Gateway perform a backoff retry on rev message?
Should be straightforward to repro this scenario in a unit test along the following lines: