You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2026/07/01 09:53:59 UTC

[PR] Fix S2095 resource leaks in camel-test-infra-openai-mock [camel]

gnodet opened a new pull request, #24359:
URL: https://github.com/apache/camel/pull/24359

   _Claude Code on behalf of Guillaume Nodet_
   
   ## Summary
   
   - Close `InputStream` from `HttpExchange.getRequestBody()` using try-with-resources in `AudioTranscriptionRequestHandler`, `EmbeddingRequestHandler`, and `RequestHandler`
   - Close `HttpClient` instances in all 7 test classes using a `finally` block with `instanceof AutoCloseable` guard -- compatible with `--release 17` compilation while correctly closing the client on Java 21+ runtimes where `HttpClient` implements `AutoCloseable`
   
   Fixes all 17 SonarCloud S2095 (Resources should be closed) blocker issues reported for `test-infra/camel-test-infra-openai-mock`, plus 3 additional `InputStream` leaks in the handler classes.
   
   ## Test plan
   
   - [x] `mvn clean install -f test-infra/camel-test-infra-openai-mock/pom.xml -Dquickly` passes
   - [x] `mvn formatter:format impsort:sort` reports no changes needed
   - [ ] CI build passes
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix S2095 resource leaks in camel-test-infra-openai-mock [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24359:
URL: https://github.com/apache/camel/pull/24359#issuecomment-4853040647

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix S2095 resource leaks in camel-test-infra-openai-mock [camel]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet closed pull request #24359: Fix S2095 resource leaks in camel-test-infra-openai-mock
URL: https://github.com/apache/camel/pull/24359


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix S2095 resource leaks in camel-test-infra-openai-mock [camel]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #24359:
URL: https://github.com/apache/camel/pull/24359#issuecomment-4862858425

   _Claude Code on behalf of Guillaume Nodet_ — Changes incorporated into #24358.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix S2095 resource leaks in camel-test-infra-openai-mock [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24359:
URL: https://github.com/apache/camel/pull/24359#issuecomment-4853260860

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `test-infra/camel-test-infra-openai-mock`
   
   <details><summary>All tested modules (13 modules)</summary>
   
   - Camel :: AI :: LangChain4j :: Agent
   - Camel :: AI :: LangChain4j :: Tools
   - Camel :: AI :: OpenAI
   - Camel :: JBang :: MCP
   - Camel :: JBang :: Plugin :: MCP
   - Camel :: JBang :: Plugin :: Route Parser
   - Camel :: JBang :: Plugin :: TUI
   - Camel :: JBang :: Plugin :: Validate
   - Camel :: Launcher :: Container
   - Camel :: Test Infra :: All test services
   - Camel :: Test Infra :: OpenAI Mock
   - Camel :: YAML DSL :: Validator
   - Camel :: YAML DSL :: Validator Maven Plugin
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/28509083901)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org