Fix concurrency, logging, and error handling issues (#1988, #1989, #1991, #1995) - #2116
Fix concurrency, logging, and error handling issues (#1988, #1989, #1991, #1995)#2116slachiewicz wants to merge 3 commits into
Conversation
|
Can we get the build green? |
ee4724b to
4b1572c
Compare
|
Dropped the
The daemon died before it could connect back, the client's #1989 is not reachable by adding the dependency either: the fork would also need an SLF4J binding, and without one the daemon logs nothing. Verified: This comment was created with AI assistance. |
Summary of Changes
This PR addresses four open defects identified during the code audit:
PutTaskRequestContent.java, changecatch (Throwable t)tocatch (Exception t)at lines 246 and 298. CatchingThrowabletrapped JVM fatal errors (OutOfMemoryError,StackOverflowError,LinkageError) and wrapped them into failed content chunks rather than letting them propagate for proper diagnostics.IpcServer.java, replace directSystem.out/System.errconsole writes with standard SLF4JLogger(LOGGER.debug,LOGGER.info,LOGGER.error), ensuring server output integrates with standard logging configurations.IpcClient.java, synchronize retrieval and operations on volatile fields (output,input,socket) to prevent race conditions and NPEs whenclose()is invoked concurrently with activesend()orreceive().CollectResult.java, backexceptionsandcyclescollections withCopyOnWriteArrayListand add thread-safe accessors (setExceptions,setCycles), ensuring thread-safe access during multi-threaded dependency collection (such as inBfDependencyCollector).Verification
mvn test -pl maven-resolver-transport-jetty,maven-resolver-named-locks-ipc,maven-resolver-api,maven-resolver-implpassed with 781 tests, 0 failures, 0 errors.This change was created with AI assistance.