Repository navigation
RESTHeart 9.12.3
A hardening release for servers that many tenants share. It adds caps on what one caller can hold open or make the server compute: MCP sessions and subscriptions, the depth and complexity of a GraphQL query, and the time a count may take. Nothing changes unless you set the new keys; the defaults are off, as before.
MCP: sessions and subscriptions per scope (#781)
Every initialize creates a session in memory, and a session with a resource subscription is never ended by session-idle-timeout-seconds, by design. A client that keeps initializing, or that subscribes and goes away, leaves sessions and subscriptions that grow without bound.
Two keys cap them, per scope (the whole server when there is no scope provider):
/mcpService/max-sessions-per-scope: 0 # 0 = no cap
/mcpService/max-subscriptions-per-scope: 0 # 0 = no capOne more session than the cap is refused at initialize with 429 and a JSON-RPC error that says how many are alive and how to make room (DELETE /mcp, or wait for an idle one to expire). One more subscription is refused at resources/subscribe with a JSON-RPC error.
A plugin that wants the numbers, to cap them by its own rules, reads them from McpService.instance(): sessions(scope), subscriptions(scope) and scopes().
GraphQL: the shape of a query is bounded (#782)
query-time-limit bounds how long a query runs. It said nothing about its shape: a query nested deep, or selecting very many fields, was stopped only when it had already spent its time on the database. Two keys, wired to graphql-java's MaxQueryDepthInstrumentation and MaxQueryComplexityInstrumentation:
/graphql/max-query-depth: 0 # 0 = no cap; 10 suits a shared server
/graphql/max-query-complexity: 0 # 0 = no cap; 1000 suits a shared serverA query over either cap is refused with 400 and the error of the instrumentation, before any resolver runs.
Mongo: the count honours query-time-limit (#783)
/mongo/query-time-limit applied to the find of a collection read, not to its count: a GET with ?count and a filter no index serves scanned the collection with no bound. The count now runs with the same maxTime.
Other changes
- The default configuration files and the documentation describe the new keys.
Full Changelog: 9.12.2...9.12.3