Skip to content

Commit

Permalink
Merge pull request #5805 from clebergnu/term_kill_race
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Richter <[email protected]>
  • Loading branch information
richtja committed Nov 16, 2023
2 parents 53c4418 + 9ff8009 commit 68b7bb8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions avocado/plugins/spawners/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ async def wait_task(runtime_task): # pylint: disable=W0221
await runtime_task.spawner_handle.wait_task

async def terminate_task(self, runtime_task):
runtime_task.spawner_handle.process.terminate()
try:
runtime_task.spawner_handle.process.terminate()
except ProcessLookupError:
return True
soft_interval = self.config.get(
"runner.task.interval.from_soft_to_hard_termination"
)
Expand All @@ -84,7 +87,10 @@ async def terminate_task(self, runtime_task):
runtime_task.spawner_handle.process.wait(), soft_interval
)
except asyncio.TimeoutError:
runtime_task.spawner_handle.process.kill()
try:
runtime_task.spawner_handle.process.kill()
except ProcessLookupError:
return True
hard_interval = self.config.get(
"runner.task.interval.from_hard_termination_to_verification"
)
Expand Down

0 comments on commit 68b7bb8

Please sign in to comment.