Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
72squared opened this issue Jun 29, 2016 · 2 comments
Closed

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

72squared opened this issue Jun 29, 2016 · 2 comments

Comments

@72squared
Copy link

We send out about 2.4 million APNS requests every day. Anywhere from 30 to 40 run into an exception with this backtrace:

Traceback (most recent call last): -- File /srv/sites/marcopolo/notify/push_apns.py, line 154, 
    in push_apns conn.send_notification(token_hex=push_token, notification=notification, topic=topic, expiration=expiry)
    File /opt/venv-marcopolo/src/apns2/apns2/client.py, line 38, in send_notification resp = self.__connection.get_response(stream_id)
    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()
    /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'

Not sure what causes it. Maybe some sort of race condition? This happens in a background job system which does use threads, so maybe there is a race condition in the library where it removes the self._sock objects from the connection in one thread and tries to use it in another? I'm not totally convinced that's the problem though because it happens in short bursts across multiple webservers. Maybe some sort of network disruption event causes it?

@Pr0Ger
Copy link
Owner

Pr0Ger commented Jun 30, 2016

Since this is actually a hyper issue I'm closing this issue

@Pr0Ger Pr0Ger closed this as completed Jun 30, 2016
@72squared
Copy link
Author

Since it bubbles up into the application in weird ways, you might want to try/catch around the call to hyper and raising a more meaningful error until it gets fixed? but yeah it's definitely a problem that should be fixed in hyper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants