Skip to content

fix(framework): Stop logging executors before completion - #7920

Draft
tanertopal wants to merge 1 commit into
agent/shutdown-heartbeat-executorsfrom
agent/shutdown-logging-executors
Draft

fix(framework): Stop logging executors before completion#7920
tanertopal wants to merge 1 commit into
agent/shutdown-heartbeat-executorsfrom
agent/shutdown-logging-executors

Conversation

@tanertopal

@tanertopal tanertopal commented Aug 18, 2026

Copy link
Copy Markdown
Member

What changed

  • stop heartbeat workers before task completion in AgentApp, ServerApp, and Simulation executors
  • drain and stop log uploaders within the same cleanup budget
  • send final task output with only the remaining exit-handler time
  • close the runtime connection after the final output attempt

Why

These executors have two authenticated background workers. Both must stop before task completion revokes the token, but their sequential cleanup must not consume the time reserved for final task output.

sequenceDiagram
    participant E as Executor
    participant H as Heartbeat worker
    participant L as Log uploader
    participant R as Runtime API
    E->>E: Disable retries
    E->>H: Stop
    E->>L: Drain and stop
    Note over H,L: Shared 2.5s cleanup deadline
    E->>R: PushTaskOutput with remaining deadline
    E->>E: Close transport
Loading

Stack

Umbrella/reference: #7895 — Prevent task executor shutdown deadlock

Merge the stack in order. After the previous PR merges, retarget this PR to main.

Validation

  • pytest py/flwr/superlink/runtime/run_serverapp_test.py py/flwr/simulation/app_test.py
  • Ruff and Black on the changed executor modules
  • git diff --check

@github-actions github-actions Bot added the Maintainer Used to determine what PRs (mainly) come from Flower maintainers. label Aug 18, 2026
@tanertopal
tanertopal force-pushed the agent/shutdown-heartbeat-executors branch from 3e28fd0 to 36f20dd Compare August 18, 2026 16:11
@tanertopal
tanertopal force-pushed the agent/shutdown-logging-executors branch from 55ffc8d to 6b27f2a Compare August 18, 2026 16:11
@tanertopal
tanertopal force-pushed the agent/shutdown-heartbeat-executors branch from 36f20dd to 543df15 Compare August 18, 2026 16:25
@tanertopal
tanertopal force-pushed the agent/shutdown-logging-executors branch from 6b27f2a to 38a2b0e Compare August 18, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintainer Used to determine what PRs (mainly) come from Flower maintainers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant