question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Closing connection due to write timeout

See original GitHub issue

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”

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
jchamberscommented, Mar 23, 2017

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!

0reactions
yi719commented, May 22, 2017

Sure, I sent you a mail.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found