slachiewicz commented on PR #2116:
URL: https://github.com/apache/maven-resolver/pull/2116#issuecomment-5545783077

   Dropped the `[#1989]` commit; the other three are unchanged. `IpcAdapterIT` 
and `IpcAdapterNoForkIT` were failing on every OS and JDK because of it.
   
   `IpcClient` forks the daemon with a two-jar classpath built from 
`getJarPath(getClass()) + getJarPath(IpcServer.class)`, both of which resolve 
to `maven-resolver-named-locks-ipc` itself. SLF4J is not on it, so the static 
`LOGGER` field failed during class initialisation in the forked JVM:
   
   ```
   $ java -cp maven-resolver-named-locks-ipc/target/classes 
org.eclipse.aether.named.ipc.IpcServer
   Exception in thread "main" java.lang.NoClassDefFoundError: 
org/slf4j/LoggerFactory
        at org.eclipse.aether.named.ipc.IpcServer.<clinit>(IpcServer.java:52)
   ```
   
   The daemon died before it could connect back, the client's `future.get(5, 
TimeUnit.SECONDS)` expired, and every lock operation surfaced as 
`RuntimeException: Unable to create new sync context`.
   
   #1989 is not reachable by adding the dependency either: the fork would also 
need an SLF4J binding, and without one the daemon logs nothing. `System.out` is 
the working channel here, since `IpcClient` already redirects the daemon's 
output to `resolver-ipcsync-<id>.log` via `ProcessBuilder.Redirect`. Reopening 
#1989 would need the classpath question settled first.
   
   Verified: `IpcAdapterIT` 9 tests, 0 failures, 0 errors, where it was 5 
failures and 4 errors before; full build 2055 tests, 0 failures, 0 errors.
   
   *This comment 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