Continuous puller replicator stops after server error


#1

It is said in CBL documentation that continuous puller never stops. I test my app for unpredictable situations for example session expired, wrong user and so on. So, I setup replicators with wrong session. This is how replication status changes:
—PULLER STATUS: offline
—PULLER STATUS: active
—PULLER STATUS: active
—PULLER STATUS: stopped

That’s all, puller doesn’t make another tries to connect with SG server.
Could you please say me is it right behaviour? Should I try to restart replicators manually?
Thanks in advance.


#2

So you’ve set up a replication specifically with invalid credentials? Yes, that needs to be restarted.

Just to be clear, when you say “restart manually”, it would be the same kind of calls used to set up a continuous replication in the first place.


#3

Thanks for reply. It’s quite often situation for my app when session expired or user has not been created in SG (due to technical details’ implementation). This is why invalid credential is right test case.

Documentation don’t tell me exactly in which cases replicator will retry make a connection and in which will not. It’s only said about Offline status. Is it right way for me to restart replication every time when I obtain replication change message where replicator has “stopped” status and error is not null?


#4

Is it right way for me to restart replication every time when I obtain replication change message where replicator has “stopped” status and error is not null?

Even if the error is null you can consider starting it again. You don’t need to worry about which cases exactly the continuous replicator will start and stop from. Just remember this: If a continuous replicator stopped it is because it felt it could not get any benefit from trying to continue. Otherwise, for errors like low connectivity, etc, it will keep trying. For an error like a 404 (or in your case 401), however, that’s a permanent error and retrying is not likely to change the outcome so it will stop.


#5

Thanks for your reply!