Details
-
Bug
-
Resolution: Won't Fix
-
Major
-
None
-
master
-
None
Description
I'm seeing a case where two Sync Gateway processes (running on different VMs) are trying to open DCP streams with the same name, and the root cause looks to be due to not seeding the random number generator in cbdatasource
This is causing the DCPReceiver to have it's OnError() called back, which in the Sync Gateway case causes the database to go offline and certain functional tests to fail, which were passing previously when using a TAP feed.
Note that in Sync Gateway 1 logs:
2017-05-03 17:20:59.351125 I | Opening DCP connection to cbdatasource-380704bb7b4d7c03
2017-05-03 17:21:00.402345 I | Opening DCP connection to cbdatasource-1408d2ac22c4d294
and in Sync Gateway 2 logs:
2017-05-03 17:21:01.114965 I | Opening DCP connection to cbdatasource-380704bb7b4d7c03
2017-05-03 17:21:01.759772 I | Opening DCP connection to cbdatasource-1408d2ac22c4d294
According to Dave Rigby: "it's certainly the case that a second DCP connection with the same key name in OPEN_CONNECTION will close the previous one".
Original sync gateway ticket: https://github.com/couchbase/sync_gateway/issues/2514