[ARVADOS] updated: ea7c7efb7d2d7429677f6d95eb92128d7574d6a5
git at public.curoverse.com
git at public.curoverse.com
Wed Apr 29 13:45:00 EDT 2015
Summary of changes:
sdk/python/arvados/keep.py | 2 ++
1 file changed, 2 insertions(+)
discards 4008f2a65be7074f606f1d95e07a670d706a53c9 (commit)
discards cfcefb3de7406b1de3af3765fdb6f8c070bbfa23 (commit)
via ea7c7efb7d2d7429677f6d95eb92128d7574d6a5 (commit)
via 213ace8be1b2279e89abcaf58de004eb8b58632c (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (4008f2a65be7074f606f1d95e07a670d706a53c9)
\
N -- N -- N (ea7c7efb7d2d7429677f6d95eb92128d7574d6a5)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit ea7c7efb7d2d7429677f6d95eb92128d7574d6a5
Author: Tom Clegg <tom at curoverse.com>
Date: Wed Apr 29 11:10:40 2015 -0400
5562: Return UA to pool if it worked well enough to get an HTTP status.
diff --git a/sdk/python/arvados/keep.py b/sdk/python/arvados/keep.py
index 60291ba..491830e 100644
--- a/sdk/python/arvados/keep.py
+++ b/sdk/python/arvados/keep.py
@@ -386,13 +386,19 @@ class KeepClient(object):
}
ok = False
self._usable = ok != False
+ if self._result.get('status_code', None):
+ # The client worked well enough to get an HTTP status
+ # code, so presumably any problems are just on the
+ # server side and it's OK to reuse the client.
+ self._put_user_agent(curl)
+ else:
+ # Don't return this client to the pool, in case it's
+ # broken.
+ curl.close()
if not ok:
_logger.debug("Request fail: GET %s => %s: %s",
url, type(self._result['error']), str(self._result['error']))
- # Don't return this ua to the pool, in case it's broken.
- curl.close()
return None
- self._put_user_agent(curl)
_logger.info("%s response: %s bytes in %s msec (%.3f MiB/sec)",
self._result['status_code'],
len(self._result['body']),
@@ -445,13 +451,15 @@ class KeepClient(object):
}
ok = False
self._usable = ok != False # still usable if ok is True or None
+ if self._result.get('status_code', None):
+ # Client is functional. See comment in get().
+ self._put_user_agent(curl)
+ else:
+ curl.close()
if not ok:
_logger.debug("Request fail: PUT %s => %s: %s",
url, type(self._result['error']), str(self._result['error']))
- # Don't return this ua to the pool, in case it's broken.
- curl.close()
return False
- self._put_user_agent(curl)
return True
def _setcurltimeouts(self, curl, timeouts):
commit 213ace8be1b2279e89abcaf58de004eb8b58632c
Author: Tom Clegg <tom at curoverse.com>
Date: Wed Apr 29 10:57:47 2015 -0400
5562: Enable TCP Keepalive for Keep requests. refs #5822
diff --git a/sdk/python/arvados/keep.py b/sdk/python/arvados/keep.py
index b26285e..60291ba 100644
--- a/sdk/python/arvados/keep.py
+++ b/sdk/python/arvados/keep.py
@@ -340,6 +340,14 @@ class KeepClient(object):
except:
ua.close()
+ def _socket_open(self, family, socktype, protocol, address):
+ """Because pycurl doesn't have CURLOPT_TCP_KEEPALIVE"""
+ s = socket.socket(family, socktype, protocol)
+ s.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
+ s.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 75)
+ s.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, 75)
+ return s
+
def get(self, locator, timeout=None):
# locator is a KeepLocator object.
url = self.root + str(locator)
@@ -350,6 +358,7 @@ class KeepClient(object):
self._headers = {}
response_body = StringIO.StringIO()
curl.setopt(pycurl.NOSIGNAL, 1)
+ curl.setopt(pycurl.OPENSOCKETFUNCTION, self._socket_open)
curl.setopt(pycurl.URL, url.encode('utf-8'))
curl.setopt(pycurl.HTTPHEADER, [
'{}: {}'.format(k,v) for k,v in self.get_headers.iteritems()])
@@ -406,6 +415,7 @@ class KeepClient(object):
self._headers = {}
response_body = StringIO.StringIO()
curl.setopt(pycurl.NOSIGNAL, 1)
+ curl.setopt(pycurl.OPENSOCKETFUNCTION, self._socket_open)
curl.setopt(pycurl.URL, url.encode('utf-8'))
curl.setopt(pycurl.POSTFIELDS, body)
curl.setopt(pycurl.CUSTOMREQUEST, 'PUT')
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list