-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
bugIncorrect, unexpected, or unintended behavior of existing codeIncorrect, unexpected, or unintended behavior of existing code
Description
Description
If the user uses both an AsyncLoggerContext (which makes all loggers to be of type AsyncLogger) and AsyncLoggerConfig, a race condition can occur, which causes context data to be lost.
Details
If both AsyncLogger and AsyncLoggerConfig are used together (which is no advised, but possible and there is a test for it):
AsyncLoggerConfig#logis called from the main disruptor thread with aRingBufferLogEventargument,AsyncLoggerConfigcallsRingBufferLogEvent#createMemento()before sending the event to its own disruptor thread. However this method does not make a copy of the context data, nor does it mark the data as "frozen",- A
RingBufferLogEvent#clear()on the main disruptor thread clears the context data. If the disruptor thread ofAsyncLoggerConfigdidn't log the message yet, it will log it without context data.
Metadata
Metadata
Assignees
Labels
bugIncorrect, unexpected, or unintended behavior of existing codeIncorrect, unexpected, or unintended behavior of existing code