maehr / maehr/quarto-cli-mcp

fix: remove a stale quarto-mcp-* directory at startup

Open
#29 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1
Forks
0
Avg merge
23m
Merged PRs (30d)
17

Description

Problem

The server removes its temporary projects on three paths: SIGINT, SIGTERM, and the end of stdin
(#24). No handler covers SIGKILL, a power loss, or a crash inside Node itself.

A directory that survives one of those paths stays in the temporary directory forever. The
directories hold rendered output, so they are not small.

Suggested fix

Sweep the temporary directory once at startup. Remove a quarto-mcp-* directory that no live
process owns.

Points to settle

  • How does the server decide that a directory is stale? An age limit is the simple answer. A lock
    file that holds the owner PID is the exact answer.
  • Two servers can run at the same time. A sweep must not remove the directory of a live sibling.
  • The sweep must not delay the handshake. Run it after connect, and log a failure instead of
    raising it.

Related

#24 fixed the normal shutdown path. This issue covers the paths that no handler can reach.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the server startup flow around connect and the existing temporary-project cleanup paths described in #24. Define stale ownership handling for simultaneous servers, sweep quarto-mcp-* directories after connect without delaying the handshake, log failures instead of raising them, and verify that live siblings' directories are preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.