fix(eval): close the parallel lane's per-item client

The subprocess worker built a fresh client per work item and never
closed it. Pool workers are reused across items, so each one
accumulated a live transport per item for the life of the sweep.
This commit is contained in:
Patrick Buckley
2026-07-29 02:45:10 -07:00
parent 176f6a9631
commit 457750e20c
+15
View File
@@ -822,6 +822,21 @@ def _run_and_score_subprocess(params: dict[str, Any]) -> dict[str, Any]:
case: dict[str, Any] = params["case"]
run_tokens = 0
try:
return _run_and_score_with(client, params, case, run_tokens)
finally:
# Pool workers are reused across work items, so an unclosed
# client accumulates one live transport per item inside the
# worker process for the life of the sweep.
with contextlib.suppress(Exception):
client.close()
def _run_and_score_with(
client: Any, params: dict[str, Any], case: dict[str, Any], run_tokens: int
) -> dict[str, Any]:
"""The body of :func:`_run_and_score_subprocess`, client lifetime
owned by the caller."""
try:
run_result = _run_single_test(
client=client,