mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-16 11:49:28 +00:00
search executor: NPROC bound counts threads, as the kernel does [skip ci]
Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
1b9d1ca85c
commit
94d6a7dd11
@@ -285,9 +285,12 @@ class InProcessExecutor:
|
||||
status = (entry / "status").read_text()
|
||||
except FileNotFoundError:
|
||||
continue
|
||||
real_uid = int(next(line for line in status.splitlines() if line.startswith("Uid:")).split()[1])
|
||||
current += real_uid == uid
|
||||
process_limit = current + 128
|
||||
fields = dict(line.split(":", 1) for line in status.splitlines() if ":" in line)
|
||||
# The kernel's NPROC counter counts threads, not processes: a single IDE or agent
|
||||
# process with 60 threads uses 60 of the allowance.
|
||||
if int(fields["Uid"].split()[0]) == uid:
|
||||
current += int(fields.get("Threads", "1").strip() or 1)
|
||||
process_limit = current + 256
|
||||
except (OSError, ValueError, IndexError, StopIteration):
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user