hyper icon indicating copy to clipboard operation
hyper copied to clipboard

AttributeError: 'NoneType' object has no attribute 'fill'

Open 72squared opened this issue 8 years ago • 8 comments

I see this error very intermittently (1 in a million requests?) while using apns2 package:

https://github.com/Pr0Ger/PyAPNs2/tree/master/apns2

Here's the traceback:

File /opt/venv-marcopolo/local/lib/python2.7/site-packages/hyper/http20/connection.py, line 293, in get_response return HTTP20Response(stream.getheaders(), stream)
File /opt/venv-marcopolo/local/lib/python2.7/site-packages/hyper/http20/stream.py, line 223, in getheaders self._recv_cb(stream_id=self.stream_id) 
File /opt/venv-marcopolo/local/lib/python2.7/site-packages/hyper/http20/connection.py, line 744, in _recv_cb self._single_read() 
File /opt/venv-marcopolo/local/lib/python2.7/site-packages/hyper/http20/connection.py, line 644, in _single_read self._sock.fill() 
AttributeError: 'NoneType' object has no attribute 'fill'

It is using the 0.6.2 hyper release. I haven't compared against using older versions of hyper.

72squared avatar Aug 16 '16 13:08 72squared

So I think this occurs when the connection has been closed while a read was queued up. We should probably raise ConnectionResetError in this case.

Lukasa avatar Aug 16 '16 13:08 Lukasa

👍

72squared avatar Aug 16 '16 13:08 72squared

Did this get resolved?

johnmanong avatar Jan 27 '17 19:01 johnmanong

Depends what you mean by resolved. We haven't started raising a better error yet.

Lukasa avatar Jan 27 '17 19:01 Lukasa

Well this AttributeError shouldn't appear though. So in a way it was resolved ;)

sigmavirus24 avatar Jan 28 '17 13:01 sigmavirus24

I've seen this error crop up while talking to APNS, which seems to be SUPER AGGRESSIVE about prematurely terminating connections. Generally, I see it pop when trying to read response headers. I just wrap the parent call to trap for (HTTP20Error, AttributeError) which fixes this.

Someone could just wrap https://github.com/Lukasa/hyper/blob/development/hyper/http20/stream.py#L228 and that would probably catch most of these.

jrconlin avatar Apr 07 '17 16:04 jrconlin

Was this bug closed via https://github.com/Lukasa/hyper/commit/4d9262444b43b7b76cf649d853fc04b834d63545 ?

jrconlin avatar Apr 07 '17 20:04 jrconlin

It's certainly possible. Try with the current master and see if you can reproduce.

Lukasa avatar Apr 07 '17 20:04 Lukasa