mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-04-18 00:49:45 +00:00
refactor(shell): use finally block to reap zombie processes on timeoutx
This commit is contained in:
parent
dbcc7cb539
commit
e2e1c9c276
@ -116,7 +116,7 @@ class ExecTool(Tool):
|
|||||||
try:
|
try:
|
||||||
os.waitpid(process.pid, os.WNOHANG)
|
os.waitpid(process.pid, os.WNOHANG)
|
||||||
except (ProcessLookupError, ChildProcessError):
|
except (ProcessLookupError, ChildProcessError):
|
||||||
pass
|
logger.debug("Process already reaped or not found: {}", e)
|
||||||
return f"Error: Command timed out after {effective_timeout} seconds"
|
return f"Error: Command timed out after {effective_timeout} seconds"
|
||||||
|
|
||||||
output_parts = []
|
output_parts = []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user