You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/config_dump can produce a remarkably huge response. This will need to be fully buffered both as a protobuf message and an in-memory continuous string. For large configs, this will be slow and may exert memory pressure as well.
See also #31755 as well as prior work streaming admin stats in #19693. This work is not trivial and has risks. See also the difficult attempt to make /stats/prometheus stream as well: #24998 which needed to be rolled back due to complexities in the Prom format that made streaming difficult. See also #28988 which adds a streaming json serializer, which probably should be used for this, rather than creating a protobuf structure and then serializing that.
The text was updated successfully, but these errors were encountered:
Commit Message: In #19693 a streaming stats implementation was introduced, dramatically reducing the amount of time and memory it takes to generate an admin http response. /config_dump (#32054) and /clusters_ (#32054) can also be improved in this way.
However, in some environments we do not want to expose an HTTP port for admin requests, and we must use the C++ API. However that API is not streaming: it buffers the entire content. This PR adds a new streaming API.
Mechanically this new functionality was easy to add as an externally callble C++ API as the Admin class already supported this model on behalf of /stats.
However there's a fair amount of complexity managing potential races between active streaming requests, server exit, and explicit cancellation of an in-progress request. So much of the effort and complexity in this PR is due to making that thread-safe and testing it.
Additional Description:
![Life of an AdminResponse (1)](https://github.com/envoyproxy/envoy/assets/1942589/28387991-406c-45d4-812e-ccd1be910c36)
Note to reviewers: if this PR is too big it can be broken into 2. The significant additions to main_common.cc, main_common.h, and main_common_test.cc need to stay together in one PR, the rest of the changes are non-functional refactors which are needed for the larger changes to work; they could be reviewed and merged first.
Risk Level: medium -- this is a new API but it does refactor some existing functionality. Using the new functionality will add some risk also as there is some careful thought required to believe we have protected against all possibilities of shutdown/cancel/admin-request races.
Testing: //test/..., and lots of tsan repeated tests for the new streaming tests. Lots of iteration to ensure every new line of main_common.cc is hit by coverage tests.
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a
Fixes: #31755
Signed-off-by: Joshua Marantz <[email protected]>
/config_dump can produce a remarkably huge response. This will need to be fully buffered both as a protobuf message and an in-memory continuous string. For large configs, this will be slow and may exert memory pressure as well.
See also #31755 as well as prior work streaming admin stats in #19693. This work is not trivial and has risks. See also the difficult attempt to make /stats/prometheus stream as well: #24998 which needed to be rolled back due to complexities in the Prom format that made streaming difficult. See also #28988 which adds a streaming json serializer, which probably should be used for this, rather than creating a protobuf structure and then serializing that.
The text was updated successfully, but these errors were encountered: