-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closing/Disposing database throws Exception because of unfinished replicators #1020
Comments
Calling Stop on the replicator is not a synchronous function so you must wait for the status to change to stopped. After that you can close the database. Let me know if that helps. |
This won't help:
Will produce an output of:
Again, this behavior is only seen if the sync gateway is offline. |
For Xamarin this sounds like #1000 but I haven't heard of this happening on UWP yet. |
FYI the fixes for that and other Xamarin replication issues are containing in the newest DB (2.1.0-db001) |
Has the new DB cleared this up @thomai-d ? |
2.1.0-db001 on UWP is still buggy. Two cases:
|
I think we already have tests that cover the second case, but I will run something like that on my machine to see if I get the same result. |
Sorry for the lack of response on this. I discovered a key problem today. Maybe this was supposed to be obvious but connecting a Another thing is that it seems LiteCore doesn't obey stop until the initial connection either succeeded or failed. I have a fix in mind to help with this though. |
…1030) Adds a test that confirms the bad behavior.
Forgot to include a message to close this, but it was closed with d3eb920 |
See the following code:
The
Close()
call throws an exception if a replicator has been started:The replicator server is down and the following snippet is the only couchbase code that is executed in my testing application. The exception is raised on Android as well as on UWP.
Library Version
2.0.0.1
.NET Runtime
Xamarin Android v27.0.2
Microsoft.NETCore.UniversalWindowsPlatform v6.0.8
Operating System / Device Details
Android OS 6.01
Windows 10 Version 1709
Log Output
log-1524763742.zip
Expected behavior
this.db.Close()
as well asthis.db.Dispose()
can be called without causing an exception.Actual behavior
this.db.Close()
as well asthis.db.Dispose()
throws an exception when a replicator is configured.Steps To Reproduce
Execute given code:
this.db = new Database(DatabaseName);
var targetEndpoint = new URLEndpoint(new Uri("ws://192.168.0.11:4984/app"));
var replConfig = new ReplicatorConfiguration(this.db, targetEndpoint);
replConfig.Authenticator = new BasicAuthenticator("GUEST", "");
replConfig.Continuous = true;
this.replicator = new Replicator(replConfig);
this.replicator.Start();
this.replicator.Stop();
this.replicator.Dispose();
this.db.Close();
The text was updated successfully, but these errors were encountered: