slachiewicz opened a new pull request, #2116:
URL: https://github.com/apache/maven-resolver/pull/2116

   ### Summary of Changes
   
   This PR addresses four open defects identified during the code audit:
   
   1. **[#1988](https://github.com/apache/maven-resolver/issues/1988)**: In 
`PutTaskRequestContent.java`, change `catch (Throwable t)` to `catch (Exception 
t)` at lines 246 and 298. Catching `Throwable` trapped JVM fatal errors 
(`OutOfMemoryError`, `StackOverflowError`, `LinkageError`) and wrapped them 
into failed content chunks rather than letting them propagate for proper 
diagnostics.
   2. **[#1989](https://github.com/apache/maven-resolver/issues/1989)**: In 
`IpcServer.java`, replace direct `System.out` / `System.err` console writes 
with standard SLF4J `Logger` (`LOGGER.debug`, `LOGGER.info`, `LOGGER.error`), 
ensuring server output integrates with standard logging configurations.
   3. **[#1991](https://github.com/apache/maven-resolver/issues/1991)**: In 
`IpcClient.java`, synchronize retrieval and operations on volatile fields 
(`output`, `input`, `socket`) to prevent race conditions and NPEs when 
`close()` is invoked concurrently with active `send()` or `receive()`.
   4. **[#1995](https://github.com/apache/maven-resolver/issues/1995)**: In 
`CollectResult.java`, back `exceptions` and `cycles` collections with 
`CopyOnWriteArrayList` and add thread-safe accessors (`setExceptions`, 
`setCycles`), ensuring thread-safe access during multi-threaded dependency 
collection (such as in `BfDependencyCollector`).
   
   ### Verification
   - `mvn test -pl 
maven-resolver-transport-jetty,maven-resolver-named-locks-ipc,maven-resolver-api,maven-resolver-impl`
 passed with 781 tests, 0 failures, 0 errors.
   - Checkstyle and Spotless verified clean.
   
   *This change was created with AI assistance.*


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

Reply via email to