couchbase / couchbase-lite-net

A lightweight, document-oriented (NoSQL), syncable database engine for .NET
http://developer.couchbase.com/mobile/
Apache License 2.0
439 stars 126 forks source link

Replication of 100,000+ documents on Xamarin Android causes app crash #969

Closed rajagp closed 6 years ago

rajagp commented 6 years ago

From forums https://forums.couchbase.com/t/multiple-buckets-multiple-replicator-objects-error/15830/7

Platform : CBL 2.0 Beta

Trying to pull 100,000+ documents (not large docs) causes app to crash.

thomas1983 commented 6 years ago

CBS 5.1 CBL 2.0 beta b022 SGW 2.0 beta

A blank solution with only Couchbase and this in app.cs

Database.SetLogLevel(LogDomain.Replicator, Couchbase.Lite.Logging.LogLevel.Verbose);
            database = new Database(DbName);
            database.Delete();
            URLEndpoint urlEndpoint = new URLEndpoint(new Uri(SyncGateWayUri + DbName));

            var replicationConfig = new ReplicatorConfiguration
            (
                new Database(DbName),
                urlEndpoint
            )
            {
                Continuous = true,
                ReplicatorType = ReplicatorType.Pull,
                Authenticator = new BasicAuthenticator(ServerUserName, ServerPassword)
            }
            ;
            ItemReplicator = new Replicator(replicationConfig);
ItemReplicator .Start();

Bucket with 100 000+ items

First build always get me a blank crash. On the second build it replicates but Errors with 1005

REPLICATION has errored LiteCoreException (1005): no status code received
{"Message":"LiteCoreException (1005): no status code received","Data":{},"InnerException":null,"TargetSite":null,"StackTrace":null,"HelpLink":null,"Source":null,"HResult":-2146233088}

Sometimes with error 1006

LiteCoreException (1006): connection closed abnormally in the vs debug
CouchbaseLite [30] 2018-2-15 03:52:21.619+01:00 Sync {Repl#378} Got LiteCore error: connection closed abnormally (7/1006) in the logcat

Or just stops...

I use the following config:

Continuous = false,
 ReplicatorType = ReplicatorType.Pull,
Authenticator = new BasicAuthenticator(ServerUserName, ServerPassword)
borrrden commented 6 years ago

Basically the same as #967 I think (but the additional info is always appreciated)

borrrden commented 6 years ago

Closing this along with the paired issue. I think I have the fix!