• Jason Tedor's avatar
    Avoid concurrent modification in mock log appender (#41424) · 01d4c541
    Jason Tedor authored
    It can be the case that while we are setting up expectations that also a
    log message is appended. For example, if we are setting up these
    expectations after a cluster has formed and messages start being sent
    around the cluster. In this case, we would hit a concurrent modification
    exception while we are mutating the expectations, and also while the
    expectations are being iterated over as a message is appended. This
    commit avoids this by using a copy-on-write array list which is safe for
    concurrent modification and iteration. Note that another possible
    approach here is to use synchronized, but that seems unnecessary since
    we don't appear to rely on messages that are sent while we are setting
    up expectations. Rather, we are setting up some expectations and some
    situation that we think will cause those expectations to be met. Using
    copy-on-write array list here is nice since we avoid bottlenecking these
    tests on synchronizing these methods.
    01d4c541
Name
Last commit
Last update
.ci Loading commit data...
.github Loading commit data...
benchmarks Loading commit data...
buildSrc Loading commit data...
client Loading commit data...
dev-tools Loading commit data...
distribution Loading commit data...
docs Loading commit data...
gradle/wrapper Loading commit data...
libs Loading commit data...
licenses Loading commit data...
modules Loading commit data...
plugins Loading commit data...
qa Loading commit data...
rest-api-spec Loading commit data...
server Loading commit data...
test Loading commit data...
x-pack Loading commit data...
.dir-locals.el Loading commit data...
.editorconfig Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
CONTRIBUTING.md Loading commit data...
LICENSE.txt Loading commit data...
NOTICE.txt Loading commit data...
README.textile Loading commit data...
TESTING.asciidoc Loading commit data...
Vagrantfile Loading commit data...
build.gradle Loading commit data...
gradle.properties Loading commit data...
gradlew Loading commit data...
gradlew.bat Loading commit data...
settings.gradle Loading commit data...