For the benefit of others, Prateek Kumar and I have spoken briefly about this issue over slack. It's not something that I've managed to reproduce yet, however, I believe I know what might be happening here.
1) We begin the restore
2) The bucket settings are passed to the Couchbase sink
3) It sees that the settings aren't equal
4) It modifies the settings so that they are
4a) It disables flush
4b) It changes the eviction policy
5) We connect to the bucket
6) Begin loading data
7) The eviction policy change takes place
8) The node disconnects us, we get a socket closed in flight/EOF error
I believe this may be a race condition when editing the bucket settings resulting in us hitting an expected behavior when modifying the eviction policy:
Bucket Eviction Warning WebUI
Changing eviction policy will restart the bucket. This will lead to closing all open connections and some downtime
It's worth noting that once we've edited the bucket settings via the REST UI we will wait for the bucket to report as healthy, however, this may not be working in this scenario. This is what I'd like to investigate further before making any code changes.