New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend backoff/retry loop when connecting to a Couchbase Server bucket #2465

Open
tleyden opened this Issue Apr 10, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@tleyden
Collaborator

tleyden commented Apr 10, 2017

It looks like Sync Gateway gives up pretty quickly if it can't connect to the bucket. For the current use case I'm testing in, it would be nice if it had a longer backoff.

Sync Gateway version

1.4.0.2

Operating system

Docker / Centos7

Config file

Not relevant

Log output

sync-gateway_1      | 2017-04-10T22:18:01.758Z Enabling logging: [HTTP+]
sync-gateway_1      | 2017-04-10T22:18:01.758Z ==== Couchbase Sync Gateway/1.4.0(2;9e18d3e) ====
sync-gateway_1      | 2017-04-10T22:18:01.758Z requestedSoftFDLimit < currentSoftFdLimit (5000 < 65536) no action needed
sync-gateway_1      | 2017-04-10T22:18:01.758Z Opening db /db as bucket "default", pool "default", server <http://couchbase-server:8091>
sync-gateway_1      | 2017-04-10T22:18:01.758Z Opening Couchbase database default on <http://couchbase-server:8091> as user "default"
couchbase-server_1  | Starting Couchbase Server -- Web UI available at http://<ip>:8091 and logs available in /opt/couchbase/var/lib/couchbase/logs
sync-gateway_1      | 2017-04-10T22:18:01.791Z Opening Couchbase database default on <http://couchbase-server:8091> as user "default"
sync-gateway_1      | 2017-04-10T22:18:01.820Z Opening Couchbase database default on <http://couchbase-server:8091> as user "default"
sync-gateway_1      | 2017-04-10T22:18:01.855Z Opening Couchbase database default on <http://couchbase-server:8091> as user "default"
sync-gateway_1      | 2017-04-10T22:18:01.910Z Opening Couchbase database default on <http://couchbase-server:8091> as user "default"
sync-gateway_1      | 2017-04-10T22:18:01.991Z Opening Couchbase database default on <http://couchbase-server:8091> as user "default"
sync-gateway_1      | 2017-04-10T22:18:02.152Z Opening Couchbase database default on <http://couchbase-server:8091> as user "default"
sync-gateway_1      | 2017-04-10T22:18:02.473Z Opening Couchbase database default on <http://couchbase-server:8091> as user "default"
sync-gateway_1      | 2017-04-10T22:18:03.127Z Opening Couchbase database default on <http://couchbase-server:8091> as user "default"
sync-gateway_1      | 2017-04-10T22:18:04.419Z Opening Couchbase database default on <http://couchbase-server:8091> as user "default"
sync-gateway_1      | 2017-04-10T22:18:06.987Z Opening Couchbase database default on <http://couchbase-server:8091> as user "default"
sync-gateway_1      | 2017-04-10T22:18:12.108Z Opening Couchbase database default on <http://couchbase-server:8091> as user "default"
sync-gateway_1      | 2017-04-10T22:18:22.368Z Opening Couchbase database default on <http://couchbase-server:8091> as user "default"
sync-gateway_1      | 2017-04-10T22:18:42.850Z Opening Couchbase database default on <http://couchbase-server:8091> as user "default"
sync-gateway_1      | 2017-04-10T22:18:42.853Z WARNING: RetryLoop for Attempt to connect to bucket : default giving up after 14 attempts -- base.RetryLoop() at util.go:301
sync-gateway_1      | 2017-04-10T22:18:42.853Z FATAL: Error opening database: 502  Unable to connect to Couchbase Server (connection refused). Please ensure it is running and reachable at the configured host and port.  Detailed error: json: cannot unmarshal array into Go value of type string -- rest.RunServer() at config.go:758
couchbaseserversyncgateway_sync-gateway_1 exited with code 1
^CGracefully stopping... (press Ctrl+C again to force)

Expected behavior

Retry for a longer period of time than 45 seconds.

Actual behavior

Gave up after retrying for 45 seconds

Steps to reproduce

  1. Launch Couchbase Server + Sync Gateway according to these docker compose instructions

tleyden added a commit to couchbase/docker that referenced this issue Apr 10, 2017

@djpongh

This comment has been minimized.

djpongh commented Apr 21, 2017

switch to using configurable retry

@djpongh djpongh added the icebox label Apr 21, 2017

@djpongh djpongh added this to the 2.1.0 milestone Jan 19, 2018

@djpongh djpongh modified the milestones: 2.1.0, 2.2.0 Feb 5, 2018

@djpongh djpongh removed the P2: medium label Feb 5, 2018

@mvysny

This comment has been minimized.

mvysny commented Mar 5, 2018

This must be resolved otherwise couchbase sync gateway can't be started with docker-compose along with couchbase server for even small-sized databases.

@djpongh djpongh added the P2: medium label Aug 22, 2018

@djpongh djpongh added P3: low and removed P2: medium labels Sep 17, 2018

@djpongh djpongh modified the milestones: Iridium, Cobalt Sep 24, 2018

@djpongh djpongh removed P3: low labels Sep 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment