Provide a way to register a custom ExceptionHandler without initializing java.util.logging
See original GitHub issueWe use the disruptor library heavily in log4j2 for fully asynchronous logging. Unfortunately, there are some edge cases which may result in a deadlock on initialization. See LOG4J2-2965 with a reproducer here: https://github.com/apache/logging-log4j2/pull/447
Ideally we would be able to provide a custom exception handler that avoids initializing the FatalExceptionHandler (thus JUL) unnecessarily: https://github.com/LMAX-Exchange/disruptor/blob/2d4762336e2ad6d475dcf0310a980c50fd5bff0b/src/main/java/com/lmax/disruptor/FatalExceptionHandler.java#L26-L28
This could be done by lazily creating the FatalExceptionHandler if no other handler has been provided when the ring buffer is started, although there are subtler approaches to reduce code change, for example wrapping the FatalExceptionHandler
Logger instance within a static inner class to delay initialization until the logger field is first accessed based on jls-12.4.2.
Would you accept a contribution as described above? Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
@carterkozak v3.4.4 (https://github.com/LMAX-Exchange/disruptor/releases/tag/3.4.4) has now been released, it should be making its way out to maven central in the next few hours.
Hope that helps you & Log4j 👍
The current master branch/pending 4.0 release currently has no schedule for getting release, it’s on a “when it’s done” timeline.
If you/Log4J are looking for this to be fixed sooner rather than later I’d be happy to merge it on to the 3.4 branch and get that released, within the next week perhaps?