elasticsearch icon indicating copy to clipboard operation
elasticsearch copied to clipboard

Make MockLogAppender threadsafe

Open rjernst opened this issue 9 months ago • 1 comments

Adding and removing appenders in Log4j is not threadsafe. Yet some tests rely on capturing logging by adding an in memory appender, MockLogAppender. This commit makes the mock logging threadsafe by creating a new, singular appender for mock logging that delegates, in a threadsafe way, to the existing appenders created. Confusingly MockLogAppender is no longer really an appender, but I'm leaving clarifying that for a followup so as to limit the scope of this PR.

closes #106425

rjernst avatar May 02 '24 16:05 rjernst

Pinging @elastic/es-core-infra (Team:Core/Infra)

elasticsearchmachine avatar May 02 '24 16:05 elasticsearchmachine

@ldematte @thecoop I believe I've addressed your comments.

rjernst avatar May 07 '24 15:05 rjernst

(btw, CI test failure looks related but should be fixable)

ldematte avatar May 08 '24 07:05 ldematte