A plugin registration failure after the Redis client is created leaves Redis connections open and the process never exits
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 77/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- redis, typescript
- Domain
- backend
Research direction
Start in src/index.ts and trace where Redis clients and broker connections are created and where the onClose hook is registered. Reproduce with the described transformRouteSchema that returns a promise, then check the related route and OAuth registration paths. Done means failed registration still closes the connections and the process exits cleanly.
Written by the indexing model from the issue text.
Description
When redis is configured, src/index.ts creates the Redis client (and the broker's duplicated connections) early, but the onClose hook that quits them is only added near the end of registration. Anything that throws in between skips it, for example:
- a
transformRouteSchemathat returns something invalid (src/routes/mcp.ts) - the OAuth client plugin failing OIDC discovery, or
clientIdMetadataDocumentwithoutresourceUri - any other route registration error
Repro: register the plugin with redis and a transformRouteSchema that returns a promise. app.ready() rejects, app.close() resolves, but three TCPSocketWrap handles remain and the process stays alive.
Expected: the process exits, as option validation already promises (the comment above it notes that "a connection opened first would be left behind").
Fix: add the Redis/broker teardown onClose right after the client is created, or catch registration errors, quit Redis and close the broker, then rethrow.
🤖 Generated with Claude Code
- Dominant language
- TypeScript
- Stars
- 62
- Forks
- 16
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 56
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from platformatic/mcp
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
platformatic/mcp#388 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
platformatic/mcp#387 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
platformatic/mcp#382 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
platformatic/mcp#381 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
platformatic/mcp#373 ·
Maintainers usually reply within 1 day
All issues in platformatic/mcp
Similar issues
-
agent-reported area/react bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Nimblesite/SharpLsp#510 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
backend refactor
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
NIAEFEUP/tts#927 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
callstackincubator/react-native-harness#296 ·
Maintainers usually reply within 1 day