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

PushMessage don't have been sent when there is a "java.io.IOException: Connection reset by peer" #115

Closed
stanislasbonifetto opened this issue Sep 1, 2014 · 2 comments

Comments

@stanislasbonifetto
Copy link

I have a web application that send a Push when a user to something that interest at an other user.

Sometime the push don't arrive at the other user.
This use case happen when i have this log at the server:

TRACE SERVER [31/Aug/2014 14:42:21] | [P8e301bfa-4eb8-41f5-9902-9608a4604aeb] | com.relayrides.pushy.apns.ApnsConnection - ApnsConnection-18 sending SendableApnsPushNotification [sequenceNumber=0, token=df07f9aab6c4f0de3f9dc7bae4332b65ae221a86f150db7e287947766b09e690, payl
oad={"aps":{"alert":"Giorgio ti ha inviato","sound":"pushsatispay.aif","badge":3}}, deliveryInvalidation=null]
TRACE SERVER [31/Aug/2014 14:42:21] | [P8e301bfa-4eb8-41f5-9902-9608a4604aeb] | com.relayrides.pushy.apns.ApnsConnection - ApnsConnection-18 successfully wrote notification 0
DEBUG SERVER [31/Aug/2014 14:42:21] | [P8e301bfa-4eb8-41f5-9902-9608a4604aeb] | com.relayrides.pushy.apns.ApnsConnection - ApnsConnection-18 caught an exception.
java.io.IOException: Connection reset by peer
    at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
    at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
    at sun.nio.ch.IOUtil.read(IOUtil.java:192)
    at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379)
    at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:311)
    at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:878)
    at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:225)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:114)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:507)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:464)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:378)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:350)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
    at java.lang.Thread.run(Thread.java:744)

It is possible that i need do the shutdown every time that the Response has done and the servlet has finished?

@jchambers
Copy link
Owner

It is possible that i need do the shutdown every time that the Response has done and the servlet has finished?

That seems very unlikely, but I'd need to know a lot more about how your application is set up to say anything useful. When are you creating a push manager? When are you shutting it down? What happens within the lifecycle of a servlet request?

@jchambers
Copy link
Owner

…so in the absence of more information, I think the most likely case is that your connections are closing and your networking layer just isn't noticing it until you try to write something. Setting an idle connection timeout (see #116) should solve this problem. Please post a comment here if you think that's off the mark.

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