clean up log.error (#1109)

This commit is contained in:
Inna Harper 2025-07-09 11:15:14 +01:00 • committed by GitHub
commit 4fee123e72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -52,9 +52,9 @@ async def terminate_posix_process_tree(process: Process, timeout_seconds: float
process.terminate()
with anyio.fail_after(timeout_seconds):
await process.wait()
except Exception as term_error:
logger.warning(f"Process termination failed for PID {pid}: {term_error}, attempting force kill")
except Exception:
logger.warning(f"Process termination failed for PID {pid}, attempting force kill")
try:
process.kill()
except Exception as kill_error:
logger.error(f"Failed to kill process {pid}: {kill_error}")
except Exception:
logger.exception(f"Failed to kill process {pid}")