FrankChen021 opened a new pull request, #19816:
URL: https://github.com/apache/druid/pull/19816

   ## What changed
   
   - Close test-owned input, output, archive, and JDBC resources with 
try-with-resources.
   - Centralize repeated stream ownership where a downstream component closes 
the stream.
   - Replace the obsolete LGTM annotation and document the few intentional 
lifecycle-owned resources with precise CodeQL suppressions.
   
   ## Why
   
   The current CodeQL snapshot reports 117 resource-lifetime warnings:
   
   - 88 `java/input-resource-leak`
   - 16 `java/output-resource-leak`
   - 13 `java/database-resource-leak`
   
   Most findings were real test cleanup gaps. The remaining ownership cases 
outlive the creating method by design and are closed by an enclosing `Closer`, 
connection, client teardown, or downstream copy operation.
   
   ## Impact
   
   This makes resource ownership explicit without changing production behavior. 
Test cleanup is deterministic, and the intentional long-lived cases are 
documented at the exact alert sites.
   
   ## Root cause
   
   Several tests relied on wrapper or fixture teardown to close nested 
resources, which CodeQL could not consistently prove. A small number of 
production and lifecycle tests intentionally transfer ownership beyond the 
creating method.
   
   ## Checks
   
   - 181 focused tests passed
   - 2 tests skipped
   - `git diff --check`
   
   Created by GPT-5.6-Sol.
   


-- 
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]

Reply via email to