diff options
author | Jason Tedor <jason@tedor.me> | 2016-11-13 18:06:12 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-13 18:06:12 -0500 |
commit | 19decd755257bf8dcddef1e369c0baa90016e114 (patch) | |
tree | 5cdb38ce26bc864fa46c404f32bfa2bd7a3948ef /core/licenses | |
parent | d273419d008631e4f2c8a8170ae4b663e1e08367 (diff) |
Hack around cluster service and logging race
When a cluster update task executes, there can be log messages after the
update task has finished processing and the new cluster state becomes
visible. The visibility of the cluster state allows the test thread in
UpdateSettingsIT#testUpdateAutoThrottleSettings and
UpdateSettingsiT#testUpdateMergeMaxThreadCount to proceed. The test
thread will remove and stop a mock appender setup at the beginning of
the test. The log messages in the cluster state update task that occur
after processing has finished can race with the removal of the
appender. Log4j will grab a reference to the appenders when processing
these log messages, and this races with the removal and stopping of the
appenders. If Log4j grabs a reference to the appenders before the mock
appender has been removed, and the test thread subsequently removes and
stops the appender before Log4j has appended the log message, Log4j will
get angry that we are appending to a stopped appender, causing the test
to fail. This commit addresses this race by waiting for the cluster
state update task to have finished processing before freeing the test
thread to make its assertions and finally remove and stop the
appender. Yes, this is a hack.
Relates #21518
Diffstat (limited to 'core/licenses')
0 files changed, 0 insertions, 0 deletions