couchbase / sync_gateway

Manages access and synchronization between Couchbase Lite and Couchbase Server
https://www.couchbase.com/products/sync-gateway
Other
447 stars 138 forks source link

CBG-3834 Close connected websocket connections on database close #7157

Open adamcfraser opened 4 days ago

adamcfraser commented 4 days ago

CBG-3834

Adds a cancellation context to database context, and passes this to blip context when receiving blipsync requests. On database close, closes cancellation context to trigger close of blip sync connections.

Have validated with android test app that CBL reconnects when database comes online, performing the following steps:

  1. Start client replication, verify replication traffic
  2. Update the database to modify the sync function (triggers a close of the database). Observed client replication closing when database was stopped, and reconnecting when database was restarted.
  3. Verified replication traffic (ensures blip connection wasn't using stale connection to closed bucket)

Integration Tests