[Twisted-Python] Twisted hangs when using pyapns

Glyph glyph at twistedmatrix.com
Wed Oct 15 23:39:40 MDT 2014


> On Oct 14, 2014, at 6:27 PM, Ni Wesley <nispray at gmail.com> wrote:
> 
> Hi,
>    The code is from our partner, so currently I won't change their code until I address this issue.
> The used pyapns code is here:  https://github.com/samuraisam/pyapns <>
> And start twisted service by command :  twistd -r epoll web --class=pyapns.server.APNSServer --port=7077 <>
> Could you please help have a look?

OK, you made me curious ;).

I looked through the code, and as it stands, I doubt my original hypothesis (a threading problem) is correct.  Threads are used only in the client talking to the pyapns server, not the pyapns server's client talking to APNS, so they're probably not interfering with it.

As far as I can tell, the ReconnectingClientFactory is set up properly.  Have you looked at the logs?  The one possibility I can think of just from examining the code is that the log messages before calling up to ReconnectingClientFactory.clientConnectionLost are raising an exception, causing the reconnection not to proceed.  That would most likely show a traceback in the logs, though.

<https://github.com/samuraisam/pyapns/blob/master/pyapns/server.py#L157-L164 <https://github.com/samuraisam/pyapns/blob/master/pyapns/server.py#L157-L164>>

Any clue?

-glyph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20141015/7c07ca90/attachment-0002.html>


More information about the Twisted-Python mailing list