]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/rest: Trim request array and limit size
authorNitzanMordhai <nmordech@redhat.com>
Tue, 28 Nov 2023 09:52:05 +0000 (09:52 +0000)
committerNitzan Mordechai <nmordech@redhat.com>
Wed, 21 Aug 2024 05:37:46 +0000 (05:37 +0000)
commit7b96e69cb744ddb0ec1ca9185246592db28d11fd
tree1d8dcf3a15bccb791b483bdd1dcf686619e83e30
parent8c38b5270159a1dafab6c2fd4bad64914cbd12b9
mgr/rest: Trim request array and limit size

Presently, the requests array in the REST module has the potential to grow
indefinitely, leading to excessive memory consumption, particularly when
dealing with lengthy and intricate request results.

To address this issue, a limit will be imposed on the requests array within
the REST module.
This limitation will be governed by the `mgr/restful/x/max_requests` configuration
parameter specific to the REST module.
when submit_request called we will check request array if exceed max_request option
if it does we will check if the future trimmed request finished and log error
message in case we are trimming un-finished requests.

Fixes: https://tracker.ceph.com/issues/59580
Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
(cherry picked from commit 58281c19171b03f3ccfa058d994d2d20e51bb412)
src/pybind/mgr/restful/module.py