benoitc/http-parser — Issue #11: ParserError: nparsed != recved (-1 != 1448)
Author: stefankoegl
Created: 2012-03-03 15:28:33+00:00
State: open

I'm using couchdbkit (current HEAD) with http-parser (also current HEAD, 09f7e7e4a8ea0e2fe887b997f958d29d3790bce1), and I'm getting errors like the one below. This mainly happens when there are a lot of simultaneous requests. In such cases, maybe one in 1000 requests results in such errors.

````
File "/usr/local/lib/python2.6/dist-packages/couchdbkit-0.6.1-py2.6.egg/couchdbkit/client.py", line 943, in first
return list(self)[0]

File "/usr/local/lib/python2.6/dist-packages/couchdbkit-0.6.1-py2.6.egg/couchdbkit/client.py", line 1040, in __len__
return self.count()

File "/usr/local/lib/python2.6/dist-packages/couchdbkit-0.6.1-py2.6.egg/couchdbkit/client.py", line 974, in count
self._fetch_if_needed()

File "/usr/local/lib/python2.6/dist-packages/couchdbkit-0.6.1-py2.6.egg/couchdbkit/client.py", line 1005, in _fetch_if_needed
self.fetch()

File "/usr/local/lib/python2.6/dist-packages/couchdbkit-0.6.1-py2.6.egg/couchdbkit/client.py", line 987, in fetch
self._result_cache = self.view._exec(**self.params).json_body

File "/usr/local/lib/python2.6/dist-packages/couchdbkit-0.6.1-py2.6.egg/couchdbkit/client.py", line 1075, in _exec
return self._db.res.get(self.view_path, **params)

File "/usr/local/lib/python2.6/dist-packages/restkit-4.1.2-py2.6.egg/restkit/resource.py", line 114, in get
params_dict=params_dict, **params)

File "/usr/local/lib/python2.6/dist-packages/couchdbkit-0.6.1-py2.6.egg/couchdbkit/resource.py", line 111, in request
payload=payload, headers=headers, **params)

File "/usr/local/lib/python2.6/dist-packages/restkit-4.1.2-py2.6.egg/restkit/resource.py", line 190, in request
headers=self.make_headers(headers))

File "/usr/local/lib/python2.6/dist-packages/restkit-4.1.2-py2.6.egg/restkit/client.py", line 412, in request
return self.perform(request)

File "/usr/local/lib/python2.6/dist-packages/restkit-4.1.2-py2.6.egg/restkit/client.py", line 356, in perform
return self.get_response(request, conn)

File "/usr/local/lib/python2.6/dist-packages/restkit-4.1.2-py2.6.egg/restkit/client.py", line 449, in get_response
location = p.headers().get('location')

File "/usr/local/lib/python2.6/dist-packages/http_parser/http.py", line 145, in headers
self._check_headers_complete()

File "/usr/local/lib/python2.6/dist-packages/http_parser/http.py", line 66, in _check_headers_complete
data = self.next()

File "/usr/local/lib/python2.6/dist-packages/http_parser/http.py", line 212, in next
recved))

ParserError: nparsed != recved (-1 != 1448)
````