You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by nickva <gi...@git.apache.org> on 2015/10/07 03:20:42 UTC
[GitHub] couchdb pull request: Clean working directory before new travis bu...
GitHub user nickva opened a pull request:
https://github.com/apache/couchdb/pull/353
Clean working directory before new travis build
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/cloudant/couchdb fix-travis-build
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/couchdb/pull/353.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #353
----
commit 7d7fa7849995ce28fcc6294a23d29c887b708216
Author: Nick Vatamaniuc <va...@gmail.com>
Date: 2015-10-07T01:03:25Z
Clean working directory before new travis build
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb pull request: Retry database creation during cluster setup
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/couchdb/pull/353
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb pull request: Retry database creation during cluster setup
Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on a diff in the pull request:
https://github.com/apache/couchdb/pull/353#discussion_r41353725
--- Diff: dev/run ---
@@ -476,17 +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())
--- End diff --
No need parentheses here, space after comma. Retries check better have in while condition to avoid potential infinity loop here.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb pull request: Retry database creation during cluster setup
Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on the pull request:
https://github.com/apache/couchdb/pull/353#issuecomment-146082624
Nice found! +1 after a small fixes.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb pull request: Retry database creation during cluster setup
Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on a diff in the pull request:
https://github.com/apache/couchdb/pull/353#discussion_r41353732
--- Diff: dev/run ---
@@ -476,17 +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)
+
--- End diff --
2 spaces please
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] couchdb pull request: Retry database creation during cluster setup
Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on a diff in the pull request:
https://github.com/apache/couchdb/pull/353#discussion_r41353536
--- Diff: dev/run ---
@@ -476,17 +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()
-
+ status, res = try_request(host, port, 'PUT', '/' + dbname, (201, 202, 412))
+ assert status in (201, 202, 412), res
--- End diff --
There is no reason now to have this assert here, since it could be in else branch of try_request function.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---