summaryrefslogtreecommitdiff
path: root/swiftclient/client.py
diff options
context:
space:
mode:
authorPete Zaitcev <zaitcev@kotori.zaitcev.us>2013-05-10 21:33:17 -0600
committerPete Zaitcev <zaitcev@kotori.zaitcev.us>2013-05-10 21:33:17 -0600
commit3196daf9929eef25d69d47592beef4cd31573b80 (patch)
tree1a427b1505833476817d9c240ba6b9766b0d9aaa /swiftclient/client.py
parentfcb3100b7d6870b1ae594a7e3e34fad5db0d1180 (diff)
downloadpython-swiftclient-3196daf9929eef25d69d47592beef4cd31573b80.tar.gz
Eradicate eventlet and fix bug lp:959221
The bug is simple: whenever swift uploads to a Swift with SSL, it uses 100% CPU. It happens because we use HTTPSConnection from eventlet that loops like that, while holding the interpreter lock. Now, it could be fixed in eventlet, but let's try something more natural: drop the eventlet's HTTP client. We do not use green threads in the client anymore, so it's not like we need it for that. Note that in most cases clients do not use the BufferedHTTPConnection either, because it's only installed on Swift server nodes, not on workstations. Get rid of that too. bug: 959221 Change-Id: I1eb932779d4171598b3efaa043f817b9c6c995c4
Diffstat (limited to 'swiftclient/client.py')
-rw-r--r--swiftclient/client.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/swiftclient/client.py b/swiftclient/client.py
index f934876..3bb7e3f 100644
--- a/swiftclient/client.py
+++ b/swiftclient/client.py
@@ -25,25 +25,9 @@ from functools import wraps
from urllib import quote as _quote
from urlparse import urlparse, urlunparse
+from httplib import HTTPException, HTTPConnection, HTTPSConnection
+from time import sleep
-try:
- from eventlet.green.httplib import HTTPException, HTTPSConnection
-except ImportError:
- from httplib import HTTPException, HTTPSConnection
-
-try:
- from eventlet import sleep
-except ImportError:
- from time import sleep
-
-try:
- from swift.common.bufferedhttp \
- import BufferedHTTPConnection as HTTPConnection
-except ImportError:
- try:
- from eventlet.green.httplib import HTTPConnection
- except ImportError:
- from httplib import HTTPConnection
logger = logging.getLogger("swiftclient")