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

   When an explicitly installed configuration factory cannot reload a child 
source, `CompositeConfiguration.reconfigure()` adds its null result to the 
child list and throws a `NullPointerException`. This is reproducible with the 
built-in `XmlConfigurationFactory` and a removed XML file. The default 
meta-factory usually masks this path by returning a fallback configuration.
   
   Return null immediately when a child reload fails, using the existing 
`LoggerContext.onChange()` behavior to keep the active configuration. Pending 
changes are deferred until all child sources can reload. Update the warning to 
describe that behavior and add a changelog entry. No public API changes.
   
   The regression uses real temporary XML files and the normal change callback. 
It covers the first, second, or both sources becoming unavailable; verifies 
that the active configuration and logger levels remain unchanged; then restores 
the files and verifies that a later reload applies both new levels. A 
successful-reload control also passes. Three cases fail with NPEs before the 
fix; all four pass afterward. No sleeps or mocked null factory results.
   
   Related discussion: #115 previously noted the null factory result during 
composite reconfiguration.
   
   ## Validation
   
   JDK 17, Java release 8, Maven wrapper:
   
   ```text
   mvnw.cmd -B -ntp -pl :log4j-core-test -am 
-Dtest=CompositeConfigurationReloadTest,CompositeConfigurationMissingTest,CompositeConfigurationPostConfigureTest,ConfigurationFactoryActivationTest
 -Dsurefire.failIfNoSpecifiedTests=false -DskipITs verify
   ```
   
   - All six selected reactor modules passed.
   - Four dependency variants ran 14 cases each: 56 entries, zero 
failures/errors, three expected missing-dependency skips. All new regression 
cases passed in every variant.
   - Formatting, changelog validation, license, static-analysis, 
module-descriptor, and compatibility checks passed.
   - Six focused tests also passed after fresh source compilation.
   
   Tests were selected and integration tests were skipped; this was not a 
full-suite build.
   


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