Description
Seeing an issue where this block yields a Response with all nil
values:
Async::HTTP::Internet.post(metrics_url, headers:, body:) do |response|
pp st: response.status, hdr: response.headers, bdy: response.body
# => {st: nil, hdr: nil, bdy: nil}
end
The POST is being sent every 60 seconds, with the interval managed by a separate task and an Async::Notification to the http task. As such, it's a nearly perfect 60 second interval every time. The server runs nginx (as a proxy) and connections are using h2.
The empty Response reliably happens every 61 minutes. So, it works fine 61 times and then fails on the 62nd time. Then works for another 61, and fails on the 62nd again.
When the client yields the empty Response, the nginx logs still show the request and the normal, expected 204 response. The backend behind nginx correctly shows the post'd data from the request as well. So, it appears to be an issue on the client, or perhaps something between the client and nginx.
It feels like a race condition in combination with a maximum h2 session length, but I'm not sure a max session timeout even exists, so that could be way off. Thoughts on what this might be or how to debug it further?
async-http 0.87.0
async-pool 0.10.3
async 2.23.1
ruby 3.3.6
nginx 1.27.3