GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — mcpx: orphan-session DELETEs from #267 run synchronously on the takeover path, delaying daemon start up to 5s per removed server · Issue #291 · developing-today/code

mcpx: orphan-session DELETEs from #267 run synchronously on the takeover path, delaying daemon start up to 5s per removed server #291

New issue
Copy link
New issue
Copy link
Closed
#296
Closed
mcpx: orphan-session DELETEs from #267 run synchronously on the takeover path, delaying daemon start up to 5s per removed server#291
#296
Copy link
Assignees
dezren39

Description

@dezren39
dezren39
opened on Oct 18, 2026
Issue body actions

Finding (from PR diff review of #267)

PR #267 ends a removed server's orphaned upstream session with a synchronous HTTP DELETE during takeover — on the critical path, before the successor daemon starts serving.

Evidence (verified on current main 60f7a634)

  • pkgs/mcpx/internal/daemon/registry_handoff.go, Adoption.Attach(): loops over a.orphanSessions and calls pool.TerminateOrphanedSession(s.server, s.h) synchronously, in series.
  • pkgs/mcpx/internal/daemon/takeover.go (~line 664): ad.Attach() is called before s.startHTTP() — so every orphan DELETE delays the successor daemon accepting/serving connections.
  • pool.TerminateOrphanedSession → mcpclient.TerminateHTTPSession → HTTPTransport.closeSession (pkgs/mcpx/internal/mcpclient/http.go): the DELETE is bounded by defaults.UpstreamSessionDeleteTimeout = 5s (pkgs/mcpx/internal/defaults/defaults.json: upstream.sessionDeleteTimeout: "5s").
  • Worst case is therefore ~5s per orphaned session, in series: removing several servers from the configuration at once, where an upstream is unreachable in the worst way (packets dropped, not refused — a refused connection fails fast, a blackholed one burns the full timeout), delays the takeover by N × 5s. The case that costs the most is exactly the case where the DELETE can never succeed — cleanup for a dead server blocks the live daemon.
  • Termination is explicitly best-effort in the PR's design: failure is already handled by logging upstream.session.orphaned and leaving the session to expire upstream. Nothing about correctness requires it to complete before the daemon serves — only the abort path requires that no DELETE is sent before commit, which moving the sends to after commit/start preserves.

Why it matters

A takeover is a daemon upgrade/restart: the window where the daemon is not yet serving is user-visible downtime for every connected client. Best-effort cleanup of sessions for servers that no longer exist should never extend that window, least of all when the upstream is dead.

Acceptance criteria

  • Orphan-session termination no longer blocks the takeover's serving path: e.g. the DELETEs run after startHTTP() (still strictly after handoff commit), or concurrently under one bounded overall budget.
  • The abort path still sends no DELETE and the predecessor keeps its sessions (existing TestAbortedTakeoverLeavesARemovedServersSessionAlone passes).
  • Exactly one DELETE per orphaned session is still sent after a committed takeover, and upstream.session.terminated / upstream.session.orphaned lifecycle events are still emitted (existing takeover/orphan tests pass, adapted for any async completion).
  • A test or benchmark demonstrates a takeover with an unreachable orphan upstream completes serving without waiting out the per-session DELETE timeout.

Activity

  1. github-actions
    assigned
    dezren39
    on Oct 18, 2026
  2. dezren39
    added a commit that references this issue on Oct 18, 2026

    Merge pull request #296 from developing-today/sweep/291-orphan-delete…

    f7efb04
  3. dezren39
    closed this as completedin #296on Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.