You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2015/10/07 11:43:43 UTC
couchdb commit: updated refs/heads/master to 9e2010a
Repository: couchdb
Updated Branches:
refs/heads/master 093eafd90 -> 9e2010afe
Retry database creation during cluster setup
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/9e2010af
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/9e2010af
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/9e2010af
Branch: refs/heads/master
Commit: 9e2010afe60695af03be75f0e8e5ec57ac684842
Parents: 093eafd
Author: Nick Vatamaniuc <va...@gmail.com>
Authored: Wed Oct 7 00:35:02 2015 -0400
Committer: Robert Newson <rn...@apache.org>
Committed: Wed Oct 7 10:26:57 2015 +0100
----------------------------------------------------------------------
dev/run | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb/blob/9e2010af/dev/run
----------------------------------------------------------------------
diff --git a/dev/run b/dev/run
index 2cb1fd7..4f4c492 100755
--- a/dev/run
+++ b/dev/run
@@ -476,16 +476,24 @@ def cluster_setup_with_admin_party(ctx):
create_system_databases(host, 15984)
+def try_request(host, port, meth, path, success_codes, retries=10, retry_dt=1):
+ while True:
+ conn = httpclient.HTTPConnection(host, port)
+ conn.request(meth, path)
+ resp = conn.getresponse()
+ if resp.status in success_codes or retries == 0:
+ return resp.status, resp.read()
+ retries -= 1
+ time.sleep(retry_dt)
+
+
def create_system_databases(host, port):
for dbname in ['_users', '_replicator', '_metadata', '_global_changes']:
conn = httpclient.HTTPConnection(host, port)
conn.request('HEAD', '/' + dbname)
resp = conn.getresponse()
if resp.status == 404:
- conn = httpclient.HTTPConnection(host, port)
- conn.request('PUT', '/' + dbname)
- resp = conn.getresponse()
- assert resp.status in (201, 202), resp.read()
+ try_request(host, port, 'PUT', '/' + dbname, (201, 202, 412))
@log('Developers cluster is set up at http://127.0.0.1:{lead_port}.\n'