arturobernalg opened a new pull request, #2266: URL: https://github.com/apache/maven-resolver/pull/2266
#1989 was fixed by #2157, but reopened: `sendAcquireResponse()`'s catch block calls `error()` without the `if (!closing)` guard that protects every other log call in this class, so it can still run after `IpcServer.run()`'s `finally` block has reset the static `forkedProcess` flag to `false` during shutdown. In the real forked server process `slf4j-api` is never on the classpath (it's a `provided` dependency, and `IpcClient` only puts this module's own jar on the forked classpath), so that call then throws `NoClassDefFoundError` instead of falling back to stdout, masking whatever error it was trying to report. Wrapped the three `LoggerFactory` calls in `debug()`/`info()`/`error()` with a catch for `LinkageError`, falling back to the same stdout format already used for the forked-process path. Added `IpcServerLoggingWithoutSlf4jTest`, which loads the real compiled `IpcServer` class through a classloader that mirrors the forked process classpath (`org.slf4j.*` unresolvable, `forkedProcess` at its default `false`) and confirms `error()` crashes with `NoClassDefFoundError` without this change, and falls back cleanly with it. Also ran the module's real integration tests (`-Prun-its`, which actually fork the server) to confirm nothing else regressed: all green. --- To make clear that you license your contribution under the Apache License Version 2.0, January 2004, check one of the following: - [x] I hereby declare this contribution to be licensed under the Apache License Version 2.0, January 2004 - [ ] - [x] I hereby declare that I have filed an Apache Individual Contributor License Agreement. -- 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]
