memory: clean up active lock files on exit and termination signals
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- docker, node.js, typescript
Línea de trabajo
Read src/memory/index.ts, the lock handling in file-lock.test.ts, and src/memory/Dockerfile; compare signal handling with src/everything/transports/stdio.ts and src/everything/Dockerfile. Check the linked prototype branch for existing work. Done means active locks owned by this process are cleaned up on shutdown, locks owned by others are preserved, the Docker stop signal is configured, and the memory tests pass.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Which server?
memory (@modelcontextprotocol/server-memory)
Server version
2.1.0
How did you run the server?
From a clone of this repository
Transport
stdio
Protocol era
Modern (2026-07-28)
MCP client and version
Claude Desktop / Autonomous Agent Orchestrator
Operating system and runtime
Linux / Node.js v24+
Server configuration
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
}
}
}
Steps to reproduce
- Run @modelcontextprotocol/server-memory.
- Dispatch a mutation tool call (e.g.
create_entitiesoradd_observations) that acquires the lock viawithFileLock. - Terminate or stop the server process via SIGINT, SIGTERM, client disconnect, or container stop during the operation.
- Inspect the directory holding
memory.jsonl. - Attempt a subsequent write from another agent or container sharing the same graph file.
Expected behavior
The server should register signal handlers (SIGINT, SIGTERM) and exit cleanup hooks to remove any active lock file it currently holds, preventing orphaned lock files on abrupt shutdown.
Actual behavior
In Node.js, asynchronous finally blocks in withFileLock do not run when terminated by signals. Because src/memory registers no signal handlers (unlike src/everything/transports/stdio.ts), memory.jsonl.lock remains stranded on disk.
In multi-container or Docker environments where hostname !== os.hostname(), isLockOwnerDead returns false, forcing other agents to stall for up to 30–60 seconds before breaking the stale lock.
Additionally, in src/memory/Dockerfile, Node runs as PID 1 without STOPSIGNAL SIGINT, causing PID 1 to ignore SIGINT by default.
Already prototyped a fix?
Prompt for maintainer workflow:
"In src/memory/index.ts, track active lock files held by this process in an
activeLocksmap. On process exit and on SIGINT/SIGTERM, synchronously check if the lock file still contains our token, and if so, unlink it to avoid leaving stranded locks on abrupt shutdown. Add STOPSIGNAL SIGINT to src/memory/Dockerfile matching src/everything/Dockerfile. Add unit tests in file-lock.test.ts verifying active lock tracking and that cleanup leaves locks owned by another process intact."
Verification:
- Implemented and verified: all 231 tests in
src/memorypassing. - Working branch pushed for reference: https://github.com/Faris-as/servers/tree/memory-lock-signal-cleanup
Before you submit
- I searched existing issues and this is not a duplicate.
- This is not a security vulnerability report.
- Lenguaje dominante
- TypeScript
- Estrellas
- 91.7k
- Forks
- 11.9k
- Merge medio
- 3 h 30 min
- PR fusionados (30 d)
- 199
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de modelcontextprotocol/servers
-
fix(docker): correct stale --db-path comments in fetch/git Dockerfiles and clarify git READMEAbiertobug v2
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
modelcontextprotocol/servers#5483 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
modelcontextprotocol/servers#5482 ·
Los mantenedores suelen responder en 1 día
-
chore dependencies server-filesystem v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
modelcontextprotocol/servers#5481 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
JaAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 1/100
modelcontextprotocol/servers#5484 ·
Los mantenedores suelen responder en 1 día
-
CI: rename everything-mcp-diff.yml to mcp-interface-diff.yml, staged across a milestone mergeAbiertochore v2
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
modelcontextprotocol/servers#5463 ·
Los mantenedores suelen responder en 1 día
Todos los issues de modelcontextprotocol/servers
Issues similares
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 86/100
ranxianglei/billion-context#5893 ·
Los mantenedores suelen responder en 1 día
-
stringify escapes leading digits in pseudo-class arguments (:nth-child(1) becomes :nth-child(\31 ))Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
enhancement security severity:low
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Battle-Cattle/BCUK-Bot-4#959 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: Claude account rows no longer show the email (since #8055), so "Account 1, 2, 3" cannot be told apartPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoaccount-pool bug gui
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
lidge-jun/opencodex#8286 · 2 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día