fix: JDBC stream leak causing connection pool exhaustion #615
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/connection-pool-leak"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
OwnerFaceEmbeddingsController.getOwnerFaceEmbeddings()used.stream()on JDBC query result (line 52), which opens a JDBC cursor that is never closed. This leaks connections until HikariCP pool is exhausted (50/50 active), causing HTTP 500 on ALL API endpoints including worker job claim.Fix
Replace
.stream().findFirst().orElse(null)with.optional().orElse(null)— avoids JDBC streaming entirely.Codebase audit
Searched all
.stream()calls acrossapps/api/src/. Every other usage is on.listOfRows()or.list()results (connection already closed before streaming). No other unmanaged JDBC streams found.Version
Bump 1.09 → 1.10
fd7c1981fa717c9baefc