Skip to content

Add configureBenchmarkLogging calls across the various benchmarks#143185

Merged
joegallo merged 8 commits intoelastic:mainfrom
joegallo:benchmarks-load-log4j-plugins
Feb 27, 2026
Merged

Add configureBenchmarkLogging calls across the various benchmarks#143185
joegallo merged 8 commits intoelastic:mainfrom
joegallo:benchmarks-load-log4j-plugins

Conversation

@joegallo
Copy link
Copy Markdown
Contributor

I've been doing some work in the benchmarks, and while I was here I ran this command from the README:

./gradlew -p benchmarks/ run --args 'RoundingBenchmark.round -prounder=es -prange="2000-10-01 to 2000-11-01" -pzone=America/New_York -pinterval=10d -pcount=1000000'

And that spit out a big stacktrace, like this:

# Run progress: 0.00% complete, ETA 00:05:00
# Fork: 1 of 2
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by org.openjdk.jmh.util.Utils (file:/Users/joegallo/.gradle/caches/modules-2/files-2.1/org.openjdk.jmh/jmh-core/1.37/896f27e49105b35ea1964319c83d12082e7a79ef/jmh-core-1.37.jar)
WARNING: Please consider reporting this to the maintainers of class org.openjdk.jmh.util.Utils
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
# Warmup Iteration   1: 2026-02-26 16:04:41,119 org.elasticsearch.benchmark.indices.common.RoundingBenchmark.round-jmh-worker-1 ERROR Unable to locate plugin type for HeaderWarningAppender
2026-02-26 16:04:41,147 org.elasticsearch.benchmark.indices.common.RoundingBenchmark.round-jmh-worker-1 ERROR Unable to locate plugin for HeaderWarningAppender
2026-02-26 16:04:41,147 org.elasticsearch.benchmark.indices.common.RoundingBenchmark.round-jmh-worker-1 ERROR Unable to invoke factory method in class org.apache.logging.log4j.core.config.AppendersPlugin for element Appenders: java.lang.NullPointerException: Cannot invoke "org.apache.logging.log4j.core.config.plugins.util.PluginType.getElementName()" because "childType" is null java.lang.NullPointerException: Cannot invoke "org.apache.logging.log4j.core.config.plugins.util.PluginType.getElementName()" because "childType" is null
        at org.apache.logging.log4j.core.config.plugins.visitors.PluginElementVisitor.visit(PluginElementVisitor.java:52)
        at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.generateParameters(PluginBuilder.java:286)
        at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:137)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1138)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1063)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:664)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:258)
        at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:304)
        at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:621)
        at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:694)
        at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:711)
        at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:253)
        at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:155)
        at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
        at org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)
        at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:599)
        at org.elasticsearch.common.Rounding.<clinit>(Rounding.java:56)
        at org.elasticsearch.benchmark.indices.common.RoundingBenchmark.buildDates(RoundingBenchmark.java:90)
        at org.elasticsearch.benchmark.indices.common.jmh_generated.RoundingBenchmark_round_jmhTest._jmh_tryInit_f_roundingbenchmark0_G(RoundingBenchmark_round_jmhTest.java:456)
        at org.elasticsearch.benchmark.indices.common.jmh_generated.RoundingBenchmark_round_jmhTest.round_AverageTime(RoundingBenchmark_round_jmhTest.java:163)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:565)
        at org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:527)
        at org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:504)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
        at java.base/java.lang.Thread.run(Thread.java:1474)

2026-02-26 16:04:41,148 org.elasticsearch.benchmark.indices.common.RoundingBenchmark.round-jmh-worker-1 ERROR Unable to locate appender "console" for logger config "root"
2026-02-26 16:04:41,148 org.elasticsearch.benchmark.indices.common.RoundingBenchmark.round-jmh-worker-1 ERROR Unable to locate appender "header_warning" for logger config "org.elasticsearch.deprecation"

So I thought I'd investigate why that was and fix it.

And it turns out this seems pretty related to #143041, so I'm pinging @thecoop for a review. (For the same reason, I'm going with :Search Relevance/Vectors even though this isn't really related to that subject.)

@joegallo joegallo added >test Issues or PRs that are addressing/adding tests :Search Relevance/Vectors Vector search labels Feb 26, 2026
@joegallo joegallo requested a review from thecoop February 26, 2026 21:08
@elasticsearchmachine elasticsearchmachine added Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch v9.4.0 labels Feb 26, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search-relevance (Team:Search Relevance)

@joegallo
Copy link
Copy Markdown
Contributor Author

I updated this to account for the changes from #143056.

@joegallo joegallo requested a review from ldematte February 27, 2026 16:57
Copy link
Copy Markdown
Contributor

@ldematte ldematte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if CI passes.
We can handle NodeNamePatternConverter.setGlobalNodeName vs LogConfigurator.setNodeName separately if we need to.

@joegallo
Copy link
Copy Markdown
Contributor Author

We can handle NodeNamePatternConverter.setGlobalNodeName vs LogConfigurator.setNodeName separately if we need to.

I fussed with it slightly in 3e981b9, and it seems to work fine. But indeed, yeah, we can revisit this next week if it turns out to be sub-optimal for whatever reason.

@joegallo joegallo changed the title Add loadLog4jPlugins calls across the various benchmarks Add configureBenchmarkLogging calls across the various benchmarks Feb 27, 2026
@joegallo joegallo merged commit 1034963 into elastic:main Feb 27, 2026
35 checks passed
@joegallo joegallo deleted the benchmarks-load-log4j-plugins branch February 27, 2026 18:27
szybia added a commit to szybia/elasticsearch that referenced this pull request Feb 27, 2026
…cations

* upstream/main:
  Warn on API key version mismatch (elastic#143127)
  Fixed wrong malformed value ordering in synthetic source tests (elastic#143187)
  [ML] Fix: required_native_memory_bytes Calculated with Wrong Allocation Count (elastic#143077)
  Add configureBenchmarkLogging calls across the various benchmarks (elastic#143185)
  Mute org.elasticsearch.xpack.esql.CsvIT test {csv-spec:k8s-timeseries-avg-over-time.Avg_over_time_aggregate_metric_double_implicit_casting} elastic#143292
  Give system role permission to invoke shard refresh (elastic#143190)
  Mute testSyntheticSourceWithTranslogSnapshot (elastic#143260)
  Adds ResumeInfo Tests (elastic#142769)
  Use a static method to configure benchmark logging (elastic#143056)
  add connectors release notes (elastic#142884)
  Add CI triage guidance for AI agents (elastic#142994)
  ESQL: Data sources: ZSTD, BZIP2 (elastic#143228)
  [ES|QL] Channels issue when an agg is called with the same field (elastic#142180) (elastic#142269)
  Add support for project routing in reindex requests (elastic#142240)
tballison pushed a commit to tballison/elasticsearch that referenced this pull request Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Search Relevance/Vectors Vector search Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch >test Issues or PRs that are addressing/adding tests v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants