[ARVADOS] created: 605405d932ef0ba9168c4f1cfe6edd7738e7b813

Git user git at public.curoverse.com
Thu Apr 6 15:05:27 EDT 2017


        at  605405d932ef0ba9168c4f1cfe6edd7738e7b813 (commit)


commit 605405d932ef0ba9168c4f1cfe6edd7738e7b813
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Apr 6 15:05:21 2017 -0400

    8104: Build pycurl 7.43.0 package.

diff --git a/build/build.list b/build/build.list
index 98f6a3b..cc1db52 100644
--- a/build/build.list
+++ b/build/build.list
@@ -14,7 +14,7 @@ debian8,ubuntu1204,ubuntu1404,ubuntu1604,centos7|ciso8601|1.0.3|3|python|amd64
 debian8,ubuntu1204,centos7|pycrypto|2.6.1|3|python|amd64
 debian8,ubuntu1204,ubuntu1404,ubuntu1604|backports.ssl_match_hostname|3.5.0.1|2|python|all
 debian8,ubuntu1204,ubuntu1404,centos7|llfuse|0.41.1|3|python|amd64
-debian8,ubuntu1204,ubuntu1404,ubuntu1604,centos7|pycurl|7.19.5.3|3|python|amd64
+debian8,ubuntu1204,ubuntu1404,ubuntu1604,centos7|pycurl|7.43.0|python|amd64
 debian8,ubuntu1204,ubuntu1404,ubuntu1604,centos7|pyyaml|3.12|2|python|amd64
 debian8,ubuntu1204,ubuntu1404,ubuntu1604,centos7|rdflib|4.2.2|2|python|all
 debian8,ubuntu1204,ubuntu1404,centos7|shellescape|3.4.1|2|python|all

commit 33ec0939cd5853d1c14a621c551ac2705efd1cd7
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Apr 6 14:49:29 2017 -0400

    8104: Remove pycurl<7.21.5 dependency.

diff --git a/sdk/python/setup.py b/sdk/python/setup.py
index ed380e9..be10632 100644
--- a/sdk/python/setup.py
+++ b/sdk/python/setup.py
@@ -49,7 +49,7 @@ setup(name='arvados-python-client',
           'oauth2client >=1.4.6, <2',
           'ciso8601',
           'httplib2',
-          'pycurl >=7.19.5.1, <7.21.5',
+          'pycurl >=7.19.5.1',
           'python-gflags<3.0',
           'setuptools',
           'ws4py<0.4',

commit b594678083d6cd7efe425bb4be63a444f22ce153
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Apr 6 14:38:44 2017 -0400

    8104: OPENSOCKETFUNCTION accepts calls from pycurl 7.21.

diff --git a/sdk/python/arvados/keep.py b/sdk/python/arvados/keep.py
index da74bd1..218f9b1 100644
--- a/sdk/python/arvados/keep.py
+++ b/sdk/python/arvados/keep.py
@@ -1,4 +1,5 @@
 import cStringIO
+import collections
 import datetime
 import hashlib
 import logging
@@ -308,9 +309,22 @@ class KeepClient(object):
             except:
                 ua.close()
 
-        def _socket_open(self, family, socktype, protocol, address=None):
+        def _socket_open(self, *args, **kwargs):
+            if len(args) + len(kwargs) == 2:
+                return self._socket_open_pycurl_7_21_5(*args, **kwargs)
+            else:
+                return self._socket_open_pycurl_7_19_3(*args, **kwargs)
+
+        def _socket_open_pycurl_7_19_3(self, family, socktype, protocol, address=None):
+            return self._socket_open_pycurl_7_21_5(
+                purpose=None,
+                address=collections.namedtuple(
+                    'Address', ['family', 'socktype', 'protocol', 'addr'],
+                )(family, socktype, protocol, address))
+
+        def _socket_open_pycurl_7_21_5(self, purpose, address):
             """Because pycurl doesn't have CURLOPT_TCP_KEEPALIVE"""
-            s = socket.socket(family, socktype, protocol)
+            s = socket.socket(address.family, address.socktype, address.protocol)
             s.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
             # Will throw invalid protocol error on mac. This test prevents that.
             if hasattr(socket, 'TCP_KEEPIDLE'):

commit 7b31dd40b31bdbf7473b50fd407cd6f636657c69
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Apr 3 01:06:08 2017 -0400

    11308: Close socket after pycurl.

diff --git a/sdk/python/arvados/keep.py b/sdk/python/arvados/keep.py
index 38f332b..da74bd1 100644
--- a/sdk/python/arvados/keep.py
+++ b/sdk/python/arvados/keep.py
@@ -277,6 +277,7 @@ class KeepClient(object):
             self._result = {'error': None}
             self._usable = True
             self._session = None
+            self._socket = None
             self.get_headers = {'Accept': 'application/octet-stream'}
             self.get_headers.update(headers)
             self.put_headers = headers
@@ -307,8 +308,7 @@ class KeepClient(object):
             except:
                 ua.close()
 
-        @staticmethod
-        def _socket_open(family, socktype, protocol, address=None):
+        def _socket_open(self, family, socktype, protocol, address=None):
             """Because pycurl doesn't have CURLOPT_TCP_KEEPALIVE"""
             s = socket.socket(family, socktype, protocol)
             s.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
@@ -316,6 +316,7 @@ class KeepClient(object):
             if hasattr(socket, 'TCP_KEEPIDLE'):
                 s.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 75)
             s.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, 75)
+            self._socket = s
             return s
 
         def get(self, locator, method="GET", timeout=None):
@@ -329,7 +330,8 @@ class KeepClient(object):
                     self._headers = {}
                     response_body = cStringIO.StringIO()
                     curl.setopt(pycurl.NOSIGNAL, 1)
-                    curl.setopt(pycurl.OPENSOCKETFUNCTION, self._socket_open)
+                    curl.setopt(pycurl.OPENSOCKETFUNCTION,
+                                lambda *args, **kwargs: self._socket_open(*args, **kwargs))
                     curl.setopt(pycurl.URL, url.encode('utf-8'))
                     curl.setopt(pycurl.HTTPHEADER, [
                         '{}: {}'.format(k,v) for k,v in self.get_headers.iteritems()])
@@ -343,6 +345,10 @@ class KeepClient(object):
                         curl.perform()
                     except Exception as e:
                         raise arvados.errors.HttpError(0, str(e))
+                    finally:
+                        if self._socket:
+                            self._socket.close()
+                            self._socket = None
                     self._result = {
                         'status_code': curl.getinfo(pycurl.RESPONSE_CODE),
                         'body': response_body.getvalue(),
@@ -407,7 +413,8 @@ class KeepClient(object):
                     body_reader = cStringIO.StringIO(body)
                     response_body = cStringIO.StringIO()
                     curl.setopt(pycurl.NOSIGNAL, 1)
-                    curl.setopt(pycurl.OPENSOCKETFUNCTION, self._socket_open)
+                    curl.setopt(pycurl.OPENSOCKETFUNCTION,
+                                lambda *args, **kwargs: self._socket_open(*args, **kwargs))
                     curl.setopt(pycurl.URL, url.encode('utf-8'))
                     # Using UPLOAD tells cURL to wait for a "go ahead" from the
                     # Keep server (in the form of a HTTP/1.1 "100 Continue"
@@ -427,6 +434,10 @@ class KeepClient(object):
                         curl.perform()
                     except Exception as e:
                         raise arvados.errors.HttpError(0, str(e))
+                    finally:
+                        if self._socket:
+                            self._socket.close()
+                            self._socket = None
                     self._result = {
                         'status_code': curl.getinfo(pycurl.RESPONSE_CODE),
                         'body': response_body.getvalue(),

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list