Replication polling multiple times per second

I am having issues with web sockets being closed in Couchbase Lite, so I tried to switch to polling. With CBL logging enabled, the following entries are written a few times per second:

2017-05-25 18:21:38,581 DEBUG [5220]  [CHANGE TRACKER (SocketChangeTracker)] Making request to https://sg:4984/bucket/_changes?feed=normal&heartbeat=30000&style=all_docs&since=23127::23132&filter=sync_gateway/bychannel
2017-05-25 18:21:38,601 INFO  [3172]  [CHANGE TRACKER (ChangeTracker)] SocketChangeTracker[bucket/] Server Version: [Couchbase Sync Gateway: Version=1.4.0]
2017-05-25 18:21:38,606 DEBUG [932]  [CHANGE TRACKER (OneShotOrLongPollLogic)] Couchbase.Lite.Internal.OneShotOrLongPollLogic Finished reading stream
2017-05-25 18:21:38,611 DEBUG [932]  [CHANGE TRACKER (SocketChangeTracker)] SocketChangeTracker[bucket/] no error detected, continuing...

What is this activity and is it normal to be making requests that frequently?

I’ve also set the polling interval on the replication options to 30s, but this does not seem to change the behavior.

No, that’s not normal. It looks like PollInterval has an issue and will only be obeyed if the replication stops in error (and not as the result of a normal stop) and it will connect again as soon as it ends. I will look into that (it takes a while to track down issues like this because of all the moving parts). PollInterval is probably not a well exercised part of the library but instead if you are having trouble with web sockets you can set the UseWebSockets options to false to switch to another kind of continuous method (long poll).

I filed an issue to track this.

Thanks. Does the long polling method have the same resiliency with regard to going offline and coming back online, network interruptions, etc?

Yes, it will make its best effort to stay connected in the same way that the web socket mode will.