From 3196daf9929eef25d69d47592beef4cd31573b80 Mon Sep 17 00:00:00 2001 From: Pete Zaitcev Date: Fri, 10 May 2013 21:33:17 -0600 Subject: 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 --- swiftclient/client.py | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'swiftclient/client.py') 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") -- cgit v1.2.1