Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] XPackRestIT test {p0=text_structure/find_structure/Test NDJSON file structure analysis without overrides} timing out #74810

Closed
droberts195 opened this issue Jul 1, 2021 · 4 comments · Fixed by #74814
Labels
:ml Machine learning Team:ML Meta label for the ML team >test-failure Triaged test failures from CI

Comments

@droberts195
Copy link
Contributor

This test sometimes times out now. The problem seems to have been introduced within the last 24 hours. Since it's affecting the 7.13 branch I suspect #74581 is involved.

Build scan:
https://gradle-enterprise.elastic.co/s/qgmzvmu6uhxuu/tests/:x-pack:plugin:yamlRestTest/org.elasticsearch.xpack.test.rest.XPackRestIT/test%20%7Bp0=text_structure%2Ffind_structure%2FTest%20NDJSON%20file%20structure%20analysis%20without%20overrides%7D

Reproduction line:
./gradlew ':x-pack:plugin:yamlRestTest' --tests "org.elasticsearch.xpack.test.rest.XPackRestIT.test {p0=text_structure/find_structure/Test NDJSON file structure analysis without overrides}" -Dtests.seed=FFB537FF4CDA313A -Dtests.locale=nl -Dtests.timezone=Asia/Katmandu -Druntime.java=8

Applicable branches:
master, 7.x, 7.14, 7.13

Reproduces locally?:
Didn't try

Failure history:
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.xpack.test.rest.XPackRestIT&tests.test=test%20%7Bp0%3Dtext_structure/find_structure/Test%20NDJSON%20file%20structure%20analysis%20without%20overrides%7D

Failure excerpt:

java.lang.AssertionError: Failure at [text_structure/find_structure:6]: expected [2xx] status code but api [text_structure.find_structure] returned [500 Internal Server Error] [{"error":{"root_cause":[{"type":"timeout_exception","reason":"Aborting structure analysis during [timestamp format determination] as it has taken longer than the timeout of [10s]","stack_trace":"ElasticsearchTimeoutException[Aborting structure analysis during [timestamp format determination] as it has taken longer than the timeout of [10s]]\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TimeoutChecker.check(TimeoutChecker.java:89)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TimeoutChecker.grokCaptures(TimeoutChecker.java:110)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TimestampFormatFinder.checkCandidate(TimestampFormatFinder.java:526)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TimestampFormatFinder.addSample(TimestampFormatFinder.java:589)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureUtils.findCandidates(TextStructureUtils.java:227)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureUtils.guessTimestampField(TextStructureUtils.java:120)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.NdJsonTextStructureFinder.makeNdJsonTextStructureFinder(NdJsonTextStructureFinder.java:63)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.NdJsonTextStructureFinderFactory.createFromSample(NdJsonTextStructureFinderFactory.java:86)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.makeBestStructureFinder(TextStructureFinderManager.java:611)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.findTextStructure(TextStructureFinderManager.java:401)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.findTextStructure(TextStructureFinderManager.java:340)\n\tat org.elasticsearch.xpack.textstructure.transport.TransportFindStructureAction.buildTextStructureResponse(TransportFindStructureAction.java:54)\n\tat org.elasticsearch.xpack.textstructure.transport.TransportFindStructureAction.lambda$doExecute$0(TransportFindStructureAction.java:42)\n\tat org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:673)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n\tSuppressed: ElasticsearchException[Explanation so far:\n[Using character encoding [UTF-8], which matched the input with [15%] confidence - first [8kB] of input was pure ASCII]\n[Deciding sample is newline delimited NDJSON]\n]\n\t\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.findTextStructure(TextStructureFinderManager.java:415)\n\t\t... 7 more\n","suppressed":[{"type":"exception","reason":"Explanation so far:\n[Using character encoding [UTF-8], which matched the input with [15%] confidence - first [8kB] of input was pure ASCII]\n[Deciding sample is newline delimited NDJSON]\n","stack_trace":"ElasticsearchException[Explanation so far:\n[Using character encoding [UTF-8], which matched the input with [15%] confidence - first [8kB] of input was pure ASCII]\n[Deciding sample is newline delimited NDJSON]\n]\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.findTextStructure(TextStructureFinderManager.java:415)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.findTextStructure(TextStructureFinderManager.java:340)\n\tat org.elasticsearch.xpack.textstructure.transport.TransportFindStructureAction.buildTextStructureResponse(TransportFindStructureAction.java:54)\n\tat org.elasticsearch.xpack.textstructure.transport.TransportFindStructureAction.lambda$doExecute$0(TransportFindStructureAction.java:42)\n\tat org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:673)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n"}]}],"type":"timeout_exception","reason":"Aborting structure analysis during [timestamp format determination] as it has taken longer than the timeout of [10s]","stack_trace":"ElasticsearchTimeoutException[Aborting structure analysis during [timestamp format determination] as it has taken longer than the timeout of [10s]]\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TimeoutChecker.check(TimeoutChecker.java:89)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TimeoutChecker.grokCaptures(TimeoutChecker.java:110)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TimestampFormatFinder.checkCandidate(TimestampFormatFinder.java:526)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TimestampFormatFinder.addSample(TimestampFormatFinder.java:589)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureUtils.findCandidates(TextStructureUtils.java:227)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureUtils.guessTimestampField(TextStructureUtils.java:120)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.NdJsonTextStructureFinder.makeNdJsonTextStructureFinder(NdJsonTextStructureFinder.java:63)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.NdJsonTextStructureFinderFactory.createFromSample(NdJsonTextStructureFinderFactory.java:86)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.makeBestStructureFinder(TextStructureFinderManager.java:611)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.findTextStructure(TextStructureFinderManager.java:401)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.findTextStructure(TextStructureFinderManager.java:340)\n\tat org.elasticsearch.xpack.textstructure.transport.TransportFindStructureAction.buildTextStructureResponse(TransportFindStructureAction.java:54)\n\tat org.elasticsearch.xpack.textstructure.transport.TransportFindStructureAction.lambda$doExecute$0(TransportFindStructureAction.java:42)\n\tat org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:673)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n\tSuppressed: ElasticsearchException[Explanation so far:\n[Using character encoding [UTF-8], which matched the input with [15%] confidence - first [8kB] of input was pure ASCII]\n[Deciding sample is newline delimited NDJSON]\n]\n\t\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.findTextStructure(TextStructureFinderManager.java:415)\n\t\t... 7 more\n","suppressed":[{"type":"exception","reason":"Explanation so far:\n[Using character encoding [UTF-8], which matched the input with [15%] confidence - first [8kB] of input was pure ASCII]\n[Deciding sample is newline delimited NDJSON]\n","stack_trace":"ElasticsearchException[Explanation so far:\n[Using character encoding [UTF-8], which matched the input with [15%] confidence - first [8kB] of input was pure ASCII]\n[Deciding sample is newline delimited NDJSON]\n]\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.findTextStructure(TextStructureFinderManager.java:415)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.findTextStructure(TextStructureFinderManager.java:340)\n\tat org.elasticsearch.xpack.textstructure.transport.TransportFindStructureAction.buildTextStructureResponse(TransportFindStructureAction.java:54)\n\tat org.elasticsearch.xpack.textstructure.transport.TransportFindStructureAction.lambda$doExecute$0(TransportFindStructureAction.java:42)\n\tat org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:673)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n"}]},"status":500}]

  at __randomizedtesting.SeedInfo.seed([FFB537FF4CDA313A:77E10825E2265CC2]:0)
  at org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase.executeSection(ESClientYamlSuiteTestCase.java:451)
  at org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase.test(ESClientYamlSuiteTestCase.java:428)
  at sun.reflect.GeneratedMethodAccessor15.invoke(null:-1)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1750)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:938)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:974)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:988)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:49)
  at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:45)
  at org.apache.lucene.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:48)
  at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:64)
  at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:47)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:817)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:468)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:947)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:832)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:883)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:894)
  at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:45)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:41)
  at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
  at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
  at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:47)
  at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:64)
  at org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:54)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
  at java.lang.Thread.run(Thread.java:748)

  Caused by: java.lang.AssertionError: expected [2xx] status code but api [text_structure.find_structure] returned [500 Internal Server Error] [{"error":{"root_cause":[{"type":"timeout_exception","reason":"Aborting structure analysis during [timestamp format determination] as it has taken longer than the timeout of [10s]","stack_trace":"ElasticsearchTimeoutException[Aborting structure analysis during [timestamp format determination] as it has taken longer than the timeout of [10s]]\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TimeoutChecker.check(TimeoutChecker.java:89)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TimeoutChecker.grokCaptures(TimeoutChecker.java:110)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TimestampFormatFinder.checkCandidate(TimestampFormatFinder.java:526)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TimestampFormatFinder.addSample(TimestampFormatFinder.java:589)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureUtils.findCandidates(TextStructureUtils.java:227)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureUtils.guessTimestampField(TextStructureUtils.java:120)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.NdJsonTextStructureFinder.makeNdJsonTextStructureFinder(NdJsonTextStructureFinder.java:63)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.NdJsonTextStructureFinderFactory.createFromSample(NdJsonTextStructureFinderFactory.java:86)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.makeBestStructureFinder(TextStructureFinderManager.java:611)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.findTextStructure(TextStructureFinderManager.java:401)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.findTextStructure(TextStructureFinderManager.java:340)\n\tat org.elasticsearch.xpack.textstructure.transport.TransportFindStructureAction.buildTextStructureResponse(TransportFindStructureAction.java:54)\n\tat org.elasticsearch.xpack.textstructure.transport.TransportFindStructureAction.lambda$doExecute$0(TransportFindStructureAction.java:42)\n\tat org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:673)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n\tSuppressed: ElasticsearchException[Explanation so far:\n[Using character encoding [UTF-8], which matched the input with [15%] confidence - first [8kB] of input was pure ASCII]\n[Deciding sample is newline delimited NDJSON]\n]\n\t\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.findTextStructure(TextStructureFinderManager.java:415)\n\t\t... 7 more\n","suppressed":[{"type":"exception","reason":"Explanation so far:\n[Using character encoding [UTF-8], which matched the input with [15%] confidence - first [8kB] of input was pure ASCII]\n[Deciding sample is newline delimited NDJSON]\n","stack_trace":"ElasticsearchException[Explanation so far:\n[Using character encoding [UTF-8], which matched the input with [15%] confidence - first [8kB] of input was pure ASCII]\n[Deciding sample is newline delimited NDJSON]\n]\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.findTextStructure(TextStructureFinderManager.java:415)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.findTextStructure(TextStructureFinderManager.java:340)\n\tat org.elasticsearch.xpack.textstructure.transport.TransportFindStructureAction.buildTextStructureResponse(TransportFindStructureAction.java:54)\n\tat org.elasticsearch.xpack.textstructure.transport.TransportFindStructureAction.lambda$doExecute$0(TransportFindStructureAction.java:42)\n\tat org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:673)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n"}]}],"type":"timeout_exception","reason":"Aborting structure analysis during [timestamp format determination] as it has taken longer than the timeout of [10s]","stack_trace":"ElasticsearchTimeoutException[Aborting structure analysis during [timestamp format determination] as it has taken longer than the timeout of [10s]]\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TimeoutChecker.check(TimeoutChecker.java:89)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TimeoutChecker.grokCaptures(TimeoutChecker.java:110)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TimestampFormatFinder.checkCandidate(TimestampFormatFinder.java:526)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TimestampFormatFinder.addSample(TimestampFormatFinder.java:589)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureUtils.findCandidates(TextStructureUtils.java:227)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureUtils.guessTimestampField(TextStructureUtils.java:120)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.NdJsonTextStructureFinder.makeNdJsonTextStructureFinder(NdJsonTextStructureFinder.java:63)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.NdJsonTextStructureFinderFactory.createFromSample(NdJsonTextStructureFinderFactory.java:86)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.makeBestStructureFinder(TextStructureFinderManager.java:611)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.findTextStructure(TextStructureFinderManager.java:401)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.findTextStructure(TextStructureFinderManager.java:340)\n\tat org.elasticsearch.xpack.textstructure.transport.TransportFindStructureAction.buildTextStructureResponse(TransportFindStructureAction.java:54)\n\tat org.elasticsearch.xpack.textstructure.transport.TransportFindStructureAction.lambda$doExecute$0(TransportFindStructureAction.java:42)\n\tat org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:673)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n\tSuppressed: ElasticsearchException[Explanation so far:\n[Using character encoding [UTF-8], which matched the input with [15%] confidence - first [8kB] of input was pure ASCII]\n[Deciding sample is newline delimited NDJSON]\n]\n\t\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.findTextStructure(TextStructureFinderManager.java:415)\n\t\t... 7 more\n","suppressed":[{"type":"exception","reason":"Explanation so far:\n[Using character encoding [UTF-8], which matched the input with [15%] confidence - first [8kB] of input was pure ASCII]\n[Deciding sample is newline delimited NDJSON]\n","stack_trace":"ElasticsearchException[Explanation so far:\n[Using character encoding [UTF-8], which matched the input with [15%] confidence - first [8kB] of input was pure ASCII]\n[Deciding sample is newline delimited NDJSON]\n]\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.findTextStructure(TextStructureFinderManager.java:415)\n\tat org.elasticsearch.xpack.textstructure.structurefinder.TextStructureFinderManager.findTextStructure(TextStructureFinderManager.java:340)\n\tat org.elasticsearch.xpack.textstructure.transport.TransportFindStructureAction.buildTextStructureResponse(TransportFindStructureAction.java:54)\n\tat org.elasticsearch.xpack.textstructure.transport.TransportFindStructureAction.lambda$doExecute$0(TransportFindStructureAction.java:42)\n\tat org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:673)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n"}]},"status":500}]

    at org.junit.Assert.fail(Assert.java:88)
    at org.elasticsearch.test.rest.yaml.section.DoSection.execute(DoSection.java:354)
    at org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase.executeSection(ESClientYamlSuiteTestCase.java:444)
    at org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase.test(ESClientYamlSuiteTestCase.java:428)
    at sun.reflect.GeneratedMethodAccessor15.invoke(null:-1)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1750)
    at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:938)
    at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:974)
    at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:988)
    at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
    at org.apache.lucene.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:49)
    at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:45)
    at org.apache.lucene.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:48)
    at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:64)
    at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:47)
    at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
    at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
    at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:817)
    at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:468)
    at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:947)
    at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:832)
    at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:883)
    at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:894)
    at org.apache.lucene.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:45)
    at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
    at org.apache.lucene.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:41)
    at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
    at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
    at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
    at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
    at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
    at org.apache.lucene.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
    at org.apache.lucene.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:47)
    at org.apache.lucene.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:64)
    at org.apache.lucene.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:54)
    at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
    at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:368)
    at java.lang.Thread.run(Thread.java:748)

@droberts195 droberts195 added :ml Machine learning >test-failure Triaged test failures from CI labels Jul 1, 2021
@elasticmachine elasticmachine added the Team:ML Meta label for the ML team label Jul 1, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

@droberts195
Copy link
Contributor Author

The Gradle scan linked in the issue description is from the 7.13 branch. An example from master is https://gradle-enterprise.elastic.co/s/i4kp2fdl5c6ga

@droberts195
Copy link
Contributor Author

I suspect #74581 is involved

The implementation of #74581 has introduced an N^2 nested loop over the pattern bank. forbidCircularReferences is called for every pattern in the pattern bank but then it also loops over every pattern in the pattern bank internally, which scales N^2 on the number of patterns in the bank.

Based on the comments I believe this is unnecessary inefficiency. The loop inside forbidCircularReferences can be hoisted outside the loop in which forbidCircularReferences is called, because it's only doing a simple check of each pattern against itself, and this only needs to be done once.

Some crude timings of the runtime of the GrokTests suite show the effect:

Before #74581:

784ms
877ms
851ms

After #74581:

2662ms
3102ms
2606ms

After adjusted fix that avoids N^2 nested loop:

859ms
817ms
999ms

Even though these are very quick-and-dirty timings that would probably horrify the performance team, they show that it's possible to achieve the same protection against circular references with hardly any performance impact compared to what is currently implemented.

@droberts195
Copy link
Contributor Author

droberts195 commented Jul 1, 2021

adjusted fix that avoids N^2 nested loop

I have opened a PR with this code change: #74814

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:ml Machine learning Team:ML Meta label for the ML team >test-failure Triaged test failures from CI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants