Closing connection due to write timeout
See original GitHub issueHi,
sometimes send notifications in production environment will got errors like this:
DEBUG c.r.pushy.apns.ApnsClientHandler Closing connection due to write timeout.
DEBUG com.relayrides.pushy.apns.ApnsClient Disconnected. Next automatic reconnection attempt in 1 seconds.
DEBUG i.n.h.c.http2.Http2ConnectionHandler [id: 0x4699b554, L:/10.10.91.99:54455 ! R:api.push.apple.com/17.188.164.209:443] Sending GOAWAY failed: lastStreamId '0', errorCode '2', debugData ''. Forcing shutdown of the connection.
javax.net.ssl.SSLException: SSLEngine closed already
at io.netty.handler.ssl.SslHandler.wrap(...)(Unknown Source) ~[netty-handler-4.1.5.Final.jar:4.1.5.Final]
DEBUG com.relayrides.pushy.apns.ApnsClient Failed to write push notification: SimpleApnsPushNotification [token=, payload={"aps":{"content-available":1},"refer_url":"","seq":17002}, invalidationTime=null, priority=IMMEDIATE, topic=, apns-collapse-id=null]
java.nio.channels.ClosedChannelException: null
at io.netty.channel.AbstractChannel$AbstractUnsafe.close(...)(Unknown Source) ~[netty-transport-4.1.5.Final.jar:4.1.5.Final]
DEBUG i.n.h.c.http2.Http2ConnectionHandler [id: 0x4699b554, L:/10.10.91.99:54455 ! R:api.push.apple.com/17.188.164.209:443] Sending GOAWAY failed: lastStreamId '0', errorCode '2', debugData ''. Forcing shutdown of the connection.
javax.net.ssl.SSLException: SSLEngine closed already
at io.netty.handler.ssl.SslHandler.wrap(...)(Unknown Source) ~[netty-handler-4.1.5.Final.jar:4.1.5.Final]
DEBUG com.relayrides.pushy.apns.ApnsClient Failed to write push notification: SimpleApnsPushNotification [token=, payload={"aps":{"content-available":1},"refer_url":"","seq":16002}, invalidationTime=null, priority=IMMEDIATE, topic=, apns-collapse-id=null]
java.nio.channels.ClosedChannelException: null
at io.netty.channel.AbstractChannel$AbstractUnsafe.close(...)(Unknown Source) ~[netty-transport-4.1.5.Final.jar:4.1.5.Final]
DEBUG i.n.h.c.http2.Http2ConnectionHandler [id: 0x4699b554, L:/10.10.91.99:54455 ! R:api.push.apple.com/17.188.164.209:443] Sending GOAWAY failed: lastStreamId '0', errorCode '2', debugData ''. Forcing shutdown of the connection.
javax.net.ssl.SSLException: SSLEngine closed already
at io.netty.handler.ssl.SslHandler.wrap(...)(Unknown Source) ~[netty-handler-4.1.5.Final.jar:4.1.5.Final]
DEBUG com.relayrides.pushy.apns.ApnsClient Failed to write push notification: SimpleApnsPushNotification [token=, payload={"aps":{"content-available":1},"refer_url":"]]
Is there a bug, or something that I do wrong? I use netty-tcnative-boringssl-static"% “1.1.33.Fork22”, pushy “0.8.1”
Issue Analytics
- State:
- Created 7 years ago
- Comments:20 (11 by maintainers)
Top Results From Across the Web
Closing connection due to write timeout · Issue #433 - GitHub
Usually it happens during sending a lot (like more than 5000) of notifications continuously. And it seems that this problem is related to...
Read more >Connection Timeout vs. Read Timeout for Java Sockets
From the client side, the “read timed out” error happens if the server is taking longer to respond and send information. This could...
Read more >c - What happens when a server closes the connection and ...
If the client has nothing to send, and one second has elapsed, then it should just send a keep alive message, i.e. a...
Read more >Closing connection due to write timeout - Bountysource
Hi,. sometimes send notifications in production environment will got errors like this: DEBUG c.r.pushy.apns.ApnsClientHandler Closing ...
Read more >Common Reasons Why Connections Stay Open for a Long ...
Some of the most common issues that can lead to connections staying open for longer than intended are the following: Applications Not Properly...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Huh… that’s very strange. Based on the tcpdump output, I’m inclined to agree with your assessment that the client is unexpectedly and suddenly closing the connection. I’m not sure why that would happen, particularly without more noise about an exception nearby. My first thought is to look for pathways where an exception might be making it through the pipeline and not getting logged.
As one more point of data, @yi719, where is your server located? We have (regrettably) observed bogus network connectivity to Apple’s servers from some parts of the world; if your server is in one of those locations, it might give us a clue that this is (somehow?) related to network choppiness.
I just returned from vacation and am still catching up, so I may not be able to tackle this immediately; I’ll look into it as soon as I can, though! Thank you both for the detailed report!
Sure, I sent you a mail.