]> 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>
Tue, 20 Aug 2024 10:29:28 +0000 (10:29 +0000)
commit58281c19171b03f3ccfa058d994d2d20e51bb412
tree6f65c670670b4a2c5221c73341cbf700dee23583
parent44747ff4c79c641d5f3b15a270c46728f12fa7fa
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>
src/pybind/mgr/restful/module.py