zsewasdsdsd opened a new pull request, #4363:
URL: https://github.com/apache/logging-log4j2/pull/4363

   Fixes #4339.
   
   `JndiManager` currently routes its factory methods through the 
`AbstractManager` registry using a shared manager name. As a result, callers 
that supply different JNDI environments can reuse the same `InitialContext`.
   
   This change:
   
   * creates a fresh `JndiManager` and `InitialContext` for every factory 
invocation;
   * bypasses the `AbstractManager` registry and reference counting for 
`JndiManager`;
   * keeps `JndiManager extends AbstractManager` on the `2.x` branch for binary 
compatibility;
   * closes each context directly from `stop(long, TimeUnit)`;
   * removes the no-longer-needed `JndiManagerFactory`;
   * adds regression coverage for distinct JNDI environments and repeated 
default-manager creation;
   * adds a changelog entry.
   
   ## Verification
   
   * Before the production fix, the two new regression tests failed because 
both calls returned the same manager.
   * `JndiManagerTest`: 8 tests, 0 failures, 0 errors.
   * Related JNDI/JMS tests (`JndiManagerTest`, `JndiLookupTest`, 
`DataSourceConnectionSourceTest`, `JmsAppenderTest`): 22 tests, 0 failures, 0 
errors.
   * Targeted `verify` for `log4j-api-java9`, `log4j-core-java9`, `log4j-core`, 
and `log4j-core-test` completed successfully, including Spotless, RAT, 
SpotBugs, and BND baseline checks.
   * Local Maven runs used `-Dxml.skip=true` because fetching the external 
changelog XSD from `logging.apache.org` timed out in the local environment; the 
changelog entry itself is well-formed XML.
   
   ## Checklist
   
   * [x] Base changes on the `2.x` branch.
   * [x] Non-trivial changes contain an entry file in `src/changelog/.2.x.x`.
   * [x] Tests are provided.
   * [x] Relevant module verification succeeds locally; see verification 
details above.


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