couchbase / couchbase-lite-ios

Lightweight, embedded, syncable NoSQL database engine for iOS and MacOS apps.
Apache License 2.0
1.63k stars 297 forks source link

2.0: Close database should return BUSY error if there is an active query or live query running #2043

Closed pasin closed 6 years ago

pasin commented 6 years ago

When close or delete database, the active replicators will be stopped. However the stop process is asynchronous and could still also write something to the database such as checkpoint. After chatting with @snej, we should wait until the all replicators finish stopping (no more active replicators) with some timeout.

pasin commented 6 years ago

In 2.0, we will throw a runtime exception if there is still a replicator or a query listener registered. In 2.1, we could consider waiting for the replicator and live query to finish.

pasin commented 6 years ago

Closed in https://github.com/couchbase/couchbase-lite-ios/commit/3319e5d8fe5ad8cd4edf5916007d362585f4061e.