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

No Error handling when sockets fail #175

Open
dsanghan opened this issue Sep 22, 2016 · 4 comments
Open

No Error handling when sockets fail #175

dsanghan opened this issue Sep 22, 2016 · 4 comments

Comments

@dsanghan
Copy link

dsanghan commented Sep 22, 2016

I'm sending frames of about 50 tokens for remote fetch notifications. I sometimes get a SIGPIPE when sending notifications in close succession. The self._connection().write() crashes with the following:

Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 1082, in run
    self.function(*self.args, **self.kwargs)
  File "listen.py", line 50, in sendNotification
    apns.gateway_server.send_notification_multiple(frame)
  File "/home/dev/backend/apns.py", line 559, in send_notification_multiple
    return self.write(frame.get_frame())
  File "/home/dev/backend/apns.py", line 267, in write
    return self._connection().write(string)
  File "/usr/lib/python2.7/ssl.py", line 272, in write
    return self._sslobj.write(data)
error: [Errno 32] Broken pipe

Maybe its better if its wrapped in a try:except: and a _disconnect()/_connect() is subsequently called?

@vitriol
Copy link

vitriol commented Oct 27, 2016

having the same issue, sometimes alternating with
[SSL: BAD_WRITE_RETRY] bad write retry (_ssl.c:1625)

Not sure if they stem from the same source. Would be nice if a fix was proposed for this?

@timabbott
Copy link

Is there a workaround for this problem? I'm seeing it as well with send_notification_multiple.

@borisyankov
Copy link

I wonder if some requests succeed and others fail or is it always fail?

@timabbott
Copy link

I think my next step in debugging this is to try to confirm the possibility that this relates to having a large number of tokens.

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

4 participants