diff options
| author | blasty <blasty@local> | 2026-07-25 11:29:36 +0200 |
|---|---|---|
| committer | blasty <blasty@local> | 2026-07-25 11:29:36 +0200 |
| commit | 2d342a92f5c9995c7014b1699eaf1180aadcef26 (patch) | |
| tree | 6d12cd7a9e9b720320342416678a627678ebdaa0 /tests/test_project_ui.py | |
| parent | projects: project model + binary staging (phase 1a) (diff) | |
| download | ida-tui-2d342a92f5c9995c7014b1699eaf1180aadcef26.tar.gz ida-tui-2d342a92f5c9995c7014b1699eaf1180aadcef26.tar.xz ida-tui-2d342a92f5c9995c7014b1699eaf1180aadcef26.zip | |
projects: worker pool with memory-budgeted residency (phase 1b)
idatui/pool.py — WorkerPool keeps one live worker per project binary:
* lazy spawn on first use; staging + a scratch sweep happen first, so a database
wedged by a previously hard-killed worker reopens instead of crash-looping.
* residency is bounded by a MEMORY BUDGET (default project.memory_pct of RAM),
not a worker count — a count is the wrong knob when one project holds a 50KB
helper and a 6MB crypto lib. Cost is measured per worker from
/proc/<pid>/smaps_rollup (PSS, which splits shared pages so summing means
something).
* over budget -> evict least-recently-used, never the active or pinned binary,
and give up rather than thrash when nothing is evictable. Eviction calls
idb_save first, so returning to a binary is a DB load, not a re-analysis.
* status() feeds the switcher UI (resident/pinned/active/analysed/memory).
worker_client: fix the wedge-file bug this depends on. close() sent
__shutdown__ and then IMMEDIATELY SIGTERMed, killing the worker mid
close_database() — which is what leaves the unpacked .id0/.id1/... behind and
makes the .i64 refuse to reopen. Now it waits out a grace period (the worker
returns from serve() on __shutdown__ and closes the DB in its finally) and only
escalates if it's genuinely stuck. Also expose .pid for memory accounting.
Verified: a pilot run that used to leave echo.id0/.id1/.id2/.nam/.til now leaves
only echo.i64, and teardown is no slower (14 checks in 5s).
tests/test_pool.py: 22 checks with an injected fake client — LRU order, budget
eviction, active/pinned protection, save-before-close, thrash avoidance,
status(), teardown. Pure stdlib, no idalib.
Diffstat (limited to 'tests/test_project_ui.py')
0 files changed, 0 insertions, 0 deletions
