Never-ending Busy state

Overview:
Occasionally, I am seeing a sync endpoint go into a never ending busy state. By that I mean - the final SyncCallback with status Idle never happens. When an endpoint gets into this state, it never seems to get out of it. Restarting doesn’t help, only deleting the local DB and recreating it.

Details:
Platform: client = mac + xamarin/c# +Xamarin.Mac Full (== .Net Framework 4.8)
server = ubuntu.

I create a continuous replicator:

        var auth = new BasicAuthenticator(id, GetServerPassword());
        var sync_config = new ReplicatorConfiguration(database, new URLEndpoint(url))
        {
            ReplicatorType = ReplicatorType.PushAndPull,
            Continuous = true,
            Authenticator = auth,
            ConflictResolver = new SyncConflictResolver()
        };
        replicator = new Replicator(sync_config);
        listenerToken = replicator.AddChangeListener(SyncStatusUpdate);
        replicator.Start();

In the function SyncStatusUpdate, I update various UI elements to reflect the current status - Idle, Busy, Error, Not Started…

Normally everything is fine. I make a change to the DB, I see the SyncStatusUpdate called with:

event.Status.Activity == ReplicatorActivityLevel.Busy

and the two values event.Status.Progress.Total and e.Status.Progress.Completed have some values which indicate something is going on (I don’t know exactly what the values mean).

After a few seconds, I see a final call to SyncStatusUpdate with:

event.Status.Activity == ReplicatorActivityLevel.Idle

At this point I change the UI to reflect that the sync being idle.

However sometimes I stop receiving the idle callback. I dont know what causes the app to enter this state.

When happens then is:

  • I make a change to the DB
  • SyncStatusUpdate called with ReplicatorActivityLevel.Busy (one or more times depending on how large the sync data is)
  • SyncStatusUpdate called with ReplicatorActivityLevel.Busy and the total and completed have the same value

but SyncStatusUpdate is never called with Idle. The data actually does sync during this time and I can see this reflected at other endpoints.

This state never changes, meaning that I never see an Idle message, only Busy with total == completed. The fix is to delete the local DB and download all data from scratch.

My questions:

  • Does a Sync Callback with status Busy and total == completed mean the same as status Idle? I seem to remember somewhere that the total/completed values are not to be used literally as a percent done indicator.
  • Why does Idle go away and never come back, at least until I delete the database.

All software is up to date.
Client is a mac, server is ubuntu.

Thanks for any advice you can provide… I’m puzzled.
Cheers.
Paul

p.s. I have attached 4 images - the event.status and event.progress values for the start of a sync event and the end of a sync event (i.e. there is no “Idle” to follow).

Starting:

Finishing: