[ARVADOS] updated: 92768ce858673678aa7924f83ad41e2a9f8dd678
git at public.curoverse.com
git at public.curoverse.com
Thu Oct 22 20:09:42 EDT 2015
Summary of changes:
sdk/python/arvados/api.py | 11 +++++++++++
1 file changed, 11 insertions(+)
via 92768ce858673678aa7924f83ad41e2a9f8dd678 (commit)
via 31eb1bdc31e1d030844a6fdc7f4ba4286ec79d4f (commit)
from a81ba64fcf67efcdb1323402612ca3fe5abf7b92 (commit)
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 92768ce858673678aa7924f83ad41e2a9f8dd678
Merge: a81ba64 31eb1bd
Author: Brett Smith <brett at curoverse.com>
Date: Thu Oct 22 20:09:37 2015 -0400
Merge branch '7587-httplib2-retries-wip'
Refs #7587. Closes #7640.
commit 31eb1bdc31e1d030844a6fdc7f4ba4286ec79d4f
Author: Brett Smith <brett at curoverse.com>
Date: Wed Oct 21 12:35:45 2015 -0400
7587: PySDK retries socket.error exceptions from API requests.
diff --git a/sdk/python/arvados/api.py b/sdk/python/arvados/api.py
index 086487a..5ec5ac2 100644
--- a/sdk/python/arvados/api.py
+++ b/sdk/python/arvados/api.py
@@ -4,6 +4,7 @@ import json
import logging
import os
import re
+import socket
import types
import apiclient
@@ -60,6 +61,16 @@ def _intercept_http_request(self, uri, **kwargs):
# previous call did not succeed, so this is slightly
# risky.
return self.orig_http_request(uri, **kwargs)
+ except socket.error:
+ # This is the one case where httplib2 doesn't close the
+ # underlying connection first. Close all open connections,
+ # expecting this object only has the one connection to the API
+ # server. This is safe because httplib2 reopens connections when
+ # needed.
+ _logger.debug("Retrying API request after socket error", exc_info=True)
+ for conn in self.connections.itervalues():
+ conn.close()
+ return self.orig_http_request(uri, **kwargs)
def _patch_http_request(http, api_token):
http.arvados_api_token = api_token
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list