Skip to content

Commit

Permalink
feat(framework) Delete TaskIns/TaskRes from LinkState for stopp…
Browse files Browse the repository at this point in the history
…ed runs (#4684)
  • Loading branch information
chongshenng authored Dec 13, 2024
1 parent 2619ef0 commit 22c1ca3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/py/flwr/superexec/exec_servicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from collections.abc import Generator
from logging import ERROR, INFO
from typing import Any, Optional
from uuid import UUID

import grpc

Expand Down Expand Up @@ -160,6 +161,13 @@ def StopRun(
run_id=request.run_id,
new_status=RunStatus(Status.FINISHED, SubStatus.STOPPED, ""),
)

if update_success:
task_ids: set[UUID] = state.get_task_ids_from_run_id(request.run_id)

# Delete TaskIns and TaskRes for the `run_id`
state.delete_tasks(task_ids)

return StopRunResponse(success=update_success)

def GetLoginDetails(
Expand Down

0 comments on commit 22c1ca3

Please sign in to comment.