[3.2.3 backport] changes feed error will not cause blip clients to disconnect

Description

In the scenario that CBL starts a continuous pull replication and then the changes feed has an error like ErrChannelFeed, the changes feed will exit and the underlying blip connection will remain open. The result of this behavior is that CBL replication will remain “busy” and connected, but no changes will ever be received by the CBL client.

Sync Gateway has no way to send a unsolicited message to CBL with an error condition, and does not check a message for Error-Code so in order to terminate the replicator.

The case where ErrChannelFeed was observed was the following case of a timeout on the N1QL query:


In order to fix this, Sync Gateway should close the blip connection in a manner that CBL will restart the replicator. The plan is to use a cancelation context similar to . A cancellable context with a parent of DatabaseContext.CancelContext will be placed on BlipSyncContext and can be cancelled when this scenario is hit. This will shut down the blip connection and CBL replicator will retry the connection automatically.

Activity

Show:

CB robot February 3, 2025 at 1:31 PM

Build sync_gateway-3.2.3-7 contains sync_gateway commit d0f58a9 with commit message:
[3.2.3 backport] CBG-4446 create a cancel context inside BlipSyncContext (#7314)

CB robot January 22, 2025 at 1:41 PM

Build sync_gateway-3.2.2-12 contains sync_gateway commit ff7a6dc with commit message:
[3.2.2 backport] CBG-4446 create a cancel context inside BlipSyncContext (#7314)

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Issue Impact

Story Points

Sprint

Fix versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created January 6, 2025 at 5:10 PM
Updated April 11, 2025 at 2:50 AM
Resolved January 22, 2025 at 11:59 AM
Instabug