fix(server): reset connected characters on graceful shutdown - #80
Merged
leocagli merged 2 commits intoAug 27, 2026
Merged
Conversation
Yerickmondra15
marked this pull request as ready for review
August 18, 2026 21:07
4 tasks
This was referenced Aug 27, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resumen
SIGINTySIGTERMde forma idempotente y deja de aceptar actividad nueva durante el apagado1001y una razón visible en el frontendPOST /internal/characters/reset-connectedcon un timeout de 5 segundos y termina aunque la API no respondaSIGTERMal proceso correctoCausa raíz
El servidor no registraba handlers para las señales de apagado. Además, la imagen ejecutaba el servidor detrás de
pnpm, que terminaba al recibirSIGTERMsin entregar la señal al proceso Node, por lo que agregar solamente los handlers no habría corregidodocker compose stop.Impacto
Los personajes se desmarcan antes de detener el servidor y pueden volver a entrar después de un reinicio. Si la API está caída, el contenedor sigue terminando dentro del período de gracia de Docker. Los jugadores reciben un mensaje de reinicio en lugar del error genérico de conexión cerrada.
Closes #26
Validación
server: 3 pruebas unitarias, ESLint, TypeScript y buildfrontend: ESLint, TypeScript y buildserver/DockerfileSIGTERMcon API disponible: se observóPOST /internal/characters/reset-connected, salida0en 0,46 sSIGTERMcon API sin responder: timeout a 5 s, salida0en 5,42 s (antes del límite de 10 s)