Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: pigweed/pigweed
Branch: main
commit 92a0165ff5ef8d539ecf049c0915da6dd22ded7b
Author: Alexei Frolov <frolv@google.com>
Date: Thu Aug 15 22:52:18 2024
pw_rpc: Limit maximum stored responses in Python client
Stream RPC calls in the Python client stored an unbounded list of
received responses, which could cause issues for long-running calls
like logs. This limits that to a maximum size, keeping only the most
recent responses.
Fixes: b/262749163
Change-Id: Idea94ada35f04162093558fcc8061b15e4bc6e1d
Reviewed-on:https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/229974
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Alexei Frolov <frolv@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
M pw_rpc/py/pw_rpc/callback_client/call.py
M pw_rpc/py/pw_rpc/callback_client/impl.py
M pw_rpc/py/tests/callback_client_test.py
https://pigweed-review.git.corp.google.com/229974
Branch: main
commit 92a0165ff5ef8d539ecf049c0915da6dd22ded7b
Author: Alexei Frolov <frolv@google.com>
Date: Thu Aug 15 22:52:18 2024
pw_rpc: Limit maximum stored responses in Python client
Stream RPC calls in the Python client stored an unbounded list of
received responses, which could cause issues for long-running calls
like logs. This limits that to a maximum size, keeping only the most
recent responses.
Fixes:
Change-Id: Idea94ada35f04162093558fcc8061b15e4bc6e1d
Reviewed-on:
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Alexei Frolov <frolv@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
M pw_rpc/py/pw_rpc/callback_client/call.py
M pw_rpc/py/pw_rpc/callback_client/impl.py
M pw_rpc/py/tests/callback_client_test.py
Description
The Python RPC client's call object currently stores all stream responses in a list. The list is unbounded, so the longer the call runs, the more memory it uses. See pw_rpc/py/pw_rpc/callback_client/call.py
The client should not store all responses. The
_responses
list could be removed entirely, or it could be converted to a sliding window of some finite number of responses.