LennonChin opened a new pull request, #7865:
URL: https://github.com/apache/kyuubi/pull/7865
### Why are the changes needed?
`GET /api/openapi.json` previously scanned the entire Kyuubi Server
classpath because no resource package was specified for Swagger. This caused:
- First-request latency of several seconds or more.
- A sharp JVM memory increase of approximately 1.5 GiB, which could lead to
OOM and server restarts in memory-constrained deployments.
- Unintended Trino and Jersey WADL endpoints being included in the Kyuubi
OpenAPI document.
This PR restricts Swagger scanning to `org.apache.kyuubi.server.api.v1`,
eliminating the unnecessary full-classpath scan and preventing unrelated
endpoints from being exposed.
### How was this patch tested?
Added a regression test to `KyuubiRestFrontendServiceSuite` that verifies
`/v1/ping` is present while `/application.wadl` and `/v1/statement` are absent.
The test failed before the fix with:
```text
paths.has("/application.wadl") was true
```
Also verified against a real Kyuubi Server running:
- First `/api/openapi.json` request: **12.686s → 0.449s**
- Cached request: **0.006s → 0.005s**
- OpenAPI paths: **52 → 46**, removing the six unintended Trino/WADL paths
### Was this patch assisted by generative AI tooling?
Assisted-by: Kimi Code:Kimi (K3.1 Pro, Moonshot AI)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]