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
This commit is contained in:
parent
fcb3100b7d
commit
3196daf992
@ -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")
|
||||
|
||||
|
@ -13,8 +13,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
from httplib import HTTPException
|
||||
|
||||
from eventlet import Timeout, sleep
|
||||
from time import sleep
|
||||
|
||||
|
||||
def fake_get_keystoneclient_2_0(os_options, exc=None, **kwargs):
|
||||
@ -61,8 +60,6 @@ def fake_http_connect(*code_iter, **kwargs):
|
||||
def getresponse(self):
|
||||
if kwargs.get('raise_exc'):
|
||||
raise Exception('test')
|
||||
if kwargs.get('raise_timeout_exc'):
|
||||
raise Timeout()
|
||||
return self
|
||||
|
||||
def getexpect(self):
|
||||
|
@ -7,7 +7,6 @@ flake8==2.0
|
||||
|
||||
coverage
|
||||
discover
|
||||
eventlet
|
||||
python-keystoneclient
|
||||
sphinx>=1.1.2
|
||||
testrepository>=0.0.13
|
||||
|
Loading…
x
Reference in New Issue
Block a user