Skip to content

Commit

Permalink
Handle hanging logging client side of completed tasks
Browse files Browse the repository at this point in the history
Details on hanging tasks deadlocking over the same vm lock resources
are described in:

avocado-framework#5881 (comment)

Signed-off-by: Plamen Dimitrov <[email protected]>
  • Loading branch information
pevogam committed Apr 5, 2024
1 parent 673324f commit 393f652
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions avocado/plugins/spawners/lxc.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ async def spawn_task(self, runtime_task):
LOG.info(f"Container state: {container.state}")
LOG.info(f"Container ID: {container_id} PID: {container.init_pid}")

exitcode, output, err = LXCSpawner.run_container_cmd(
container, ["pkill", "-f", "task-run"]
)
if exitcode == 0:
LOG.warning(output)
exitcode, output, err = await LXCSpawner.run_container_cmd_async(
container, entry_point_args
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ async def spawn_task(self, runtime_task):
)
return False

status, output = session.cmd_status_output("pkill -f task-run")
if status == 0:
LOG.warning(output)
cmd = shlex.join(entry_point_args) + " > /dev/null"
timeout = self.config.get("spawner.remote.test_timeout")
status, output = await RemoteSpawner.run_remote_cmd_async(session, cmd, timeout)
Expand Down

0 comments on commit 393f652

Please sign in to comment.