]> 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:35:51 +0000 (05:35 +0000)
commit618680142165ac7b537e007bc18e7994bdd37de5
tree3cef0be9894f383a657bf7b4f3778cbe1ccf919f
parent708dfbe8bf48188419041055a94a8560004c3ff3
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