pushy: Closing connection due to write timeout

Hi,

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”

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 20 (11 by maintainers)

Most upvoted 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!