Description
I'm using lua-http to talk to Apples's push servers.
My code can be found here: https://github.com/tmolitor-stud-tu/mod_push_appserver/blob/master/mod_push_appserver_apns/mod_push_appserver_apns.lua#L98
When the HTTP/2
connection to Apple is idle for a long time (> ~15 minutes), sending a new request (R1)
makes Apple to respond with a GOAWAY
frame having the id of this new request.
This creates an endless cqueues
loop with cqueues
returning new timeouts of 0.0 seconds
in an endless loop.
Only testing connection.recv_goaway_lowest
when attempting the next (R2)
push and closing the connection if this is set, will stop the endless loop. This could be several minutes after (R1)
.
Only at this point does the call to stream:get_headers(1)
for (R1)
return with an error read: Transport endpoint is not connected
and the loop stops.
Sidenote: I had to change the cqueues integration of prosody to not reshedule an immediate cqueues run on zero second timers without running the prosody mainloop at least once, to see this happen. Using the vanilla prosody integration will result in an unresponsive server spinning forever.
Expected behaviour: Receiving a GOAWAY
frame should make running requests waiting in stream:get_headers()
, stream:get_body_as_string()
etc. having a bigger h2 stream id
than the GOAWAY
return an error instead of spinning forever.