Open jloleysens opened 1 year ago
Pinging @elastic/platform-deployment-management (Team:Deployment Management)
Thank you for opening this one, Allison. This has been a strange one, for sure! It all started with support asking me to run a query and submit the results. I put the results in the ticket, and I was told, "that's not possible!" Glad you guys figured out the issue!
Eric
(1) Create a re-readable stream (something like this). The risk is large requests putting additional pressure on Node.js memory. To mitigate we could choose a max proxy-able request size.
This solution sounds good. As for the memory pressure, the console is mainly for debugging and testing, so the request body should not be very large, such as more than 1MB, and the concurrency should also be low.
Pinging @elastic/kibana-management (Team:Kibana Management)
Describe the bug:
Console has the ability to try multiple ES hosts (from
elasticsearch.hosts
). If a request gets hung up or connection refused it will try the next host.The issue is that when a connection times out (i.e., some time passes) the proxied request body (stream) may have emitted
end
in which case it cannot be re-used in the subsequent request in which case we send the "same" request but without a body :(. This can lead to very weird issues depending on the request being made.Steps to reproduce:
Apply this diff to current main to "fake" a failed response and get Console to retry sending the request to the next host:
Send a request with a body, e.g.:
See that the above returns
400
-- clearly we did send the correct body!Expected behavior:
Console should retry the full request against each ES host OR should only try against a single host and return the appropriate error instead of this confusing response.
I think we have two options:
(1) Create a re-readable stream (something like this). The risk is large requests putting additional pressure on Node.js memory. To mitigate we could choose a max proxy-able request size.
(2) Remove the fallback functionality, although it will work “correctly” for requests without a body, rationale being we consider accumulating Console request bodies in memory too risky and so Console just works with the first host specified (as before) and we remove the possibility of this “different results for the same requests” bug that way
CC @alisonelizabeth