From 4a83deb7bc2dcfed4696cd1bf2542a947ad7c4fb Mon Sep 17 00:00:00 2001 From: blasty Date: Thu, 9 Jul 2026 15:55:38 +0200 Subject: stop piling up idalib workers; raise max-workers headroom Root cause of 'Maximum idalib worker count reached': the app bumped idle_ttl to ~never on every open, so sessions never freed and hit the default cap of 4. - app: drop the immortal bump_idle_ttl(1e9); rely on the KeepAlive heartbeat (120s) to keep the running session warm, and open with a moderate idle_ttl (1800s) so the worker self-exits and frees its slot after the TUI closes. - spawn.sh: set IDA_MCP_MAX_WORKERS (default 8) for headroom. - doc: supervisor prunes unreachable workers before counting, so killing an idle worker frees a slot on the next open. (Verified separately: big/truncated decompile results propagate renames fine via the earlier force_recompile fix.) --- idatui/app.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'idatui') diff --git a/idatui/app.py b/idatui/app.py index 3dfc553..7dc59b4 100644 --- a/idatui/app.py +++ b/idatui/app.py @@ -1040,8 +1040,11 @@ class IdaTui(App): self.app.call_from_thread(self._status, f"opening {self._open_path}…") import os path = os.path.abspath(os.path.expanduser(self._open_path)) + # Moderate idle TTL: the keepalive heartbeat (below) keeps the + # session alive while the TUI runs; once it exits the worker + # idles out and frees its slot (avoids piling up to max-workers). res = client.call("idb_open", input_path=path, - idle_ttl_sec=1_000_000_000, timeout=1800.0) + idle_ttl_sec=1800, timeout=1800.0) if not (isinstance(res, dict) and res.get("success")): err = res.get("error") if isinstance(res, dict) else res self.app.call_from_thread(self._status, f"open failed: {err}") @@ -1052,10 +1055,8 @@ class IdaTui(App): health = client.health() module = health.get("module", "?") if self._do_keepalive: - try: - client.bump_idle_ttl() - except Exception: - pass + # Keep the session warm while we run; don't make it immortal, so + # it's reclaimed after the TUI closes. self._ka = client.keepalive(interval=120.0).start() program = Program(client) except Exception as e: # noqa: BLE001 -- cgit v1.3.1-sl0p