You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ACM-38826 fix(backend): use HEAD /api for token validation to eliminate response body drain (#6537)
getAuthenticatedToken() called isAuthenticated() on every authenticated
request, which issued GET /apis to the kube API. The response body (up to
several MB on CRD-heavy clusters) was never consumed on the success path,
preventing the socket from returning to the keepAlive pool. Under sustained
load, native (external) memory accumulated proportionally to request volume.
Replace GET /apis with HEAD /api:
- HEAD responses have no message body by HTTP spec — nothing to drain
- /api (core group) is ~200 bytes of headers; it does not grow with CRDs
- Returns HTTP status so callers preserve 401/403/5xx distinctions
- No client-side caching required: OpenShift oauth-apiserver caches valid
tokens ~30 seconds server-side; failures are not cached
isAuthenticated() now returns Promise<number> (HTTP status) instead of
Promise<Response> so callers preserve upstream status codes. authenticated.ts
updated accordingly. All route tests updated to mock HEAD /api instead of
GET /apis.
Signed-off-by: Randy Bruno Piverger <21374229+Randy424@users.noreply.github.com>
Co-authored-by: Randy Bruno Piverger <21374229+Randy424@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments