rkhachatryan commented on PR #24550:
URL: https://github.com/apache/flink/pull/24550#issuecomment-2013992333

   Sure, my theory is that although the order is correct, the write to this 
field (`loggingEvents`) might not be visible to other threads, including 
threads started by Flink and logging threads (if any).
   So some threads might see `null` there, catch NPE and log it to 
ConsoleLogger.
   I'm not 100% sure that this is the issue, but it seems more likely than 
async logging or buffering of log records.
   
   The fix is to use `volatile` or avoid using field (use closure). I'm using 
both (just in case some new usage will be added later).


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