Comment 2 for bug 1313556

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

There doesn't seem to be anything special about the response: all DELETE methods currently return 204: No Content. But returning OK with a body, or even an error with a body, produces the same problem.

This could be a result of a limitation of urllib2: its Request class assumes that all requests are either GET or POST. Our client code splices in support for other methods, but that may not be enough.

To help further debugging, here's a traceback from a blocked client:

  File "/usr/lib/python2.7/dist-packages/apiclient/maas_client.py", line 244, in delete
    url, method="DELETE", headers=headers)
  File "/usr/lib/python2.7/dist-packages/apiclient/maas_client.py", line 113, in dispatch_query
    res = urllib2.urlopen(req)
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 404, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 422, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1214, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/urllib2.py", line 1187, in do_open
    r = h.getresponse(buffering=True)
  File "/usr/lib/python2.7/httplib.py", line 1045, in getresponse
    response.begin()
  File "/usr/lib/python2.7/httplib.py", line 409, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.7/httplib.py", line 365, in _read_status
    line = self.fp.readline(_MAXLINE + 1)
  File "/usr/lib/python2.7/socket.py", line 476, in readline
    data = self._sock.recv(self._rbufsize)