-
Bug
-
Resolution: Fixed
-
High
-
8.2.1
-
8.02
-
1
-
Severity 2 - Major
-
1
-
Summary
This issue is the same as https://jira.atlassian.com/browse/JRASERVER-69604 but for (LexoRankReindexer:thread-*)
Steps to reproduce:
- Extend CalculatedCFType to accept scripts
- Call com.atlassian.jira.issue.search.SearchProvider#search
- Start lexorank re-balancing
Expected Result
GreenHopper runs tasks that re-index issues in non-jira threads with Jira thread local context
Actual Result
Sample error logs:
2019-07-19 11:38:52,034 LexoRankReindexer:thread-1 ERROR ServiceRunner [r.m.j.p.g.impl.cf.FieldValueExtractor] caught exception in script field 47500 for issue CC-8176 java.lang.IllegalStateException: Incorrect usage of JIRA/lucene search API. You can only create/use: ManagedIndexSearcher inside a context (request or Jira-Thread-Local). Check: JiraThreadLocalUtils for details. at com.atlassian.jira.index.ManagedIndexSearcherFactory.createFrom(ManagedIndexSearcherFactory.java:15) at com.atlassian.jira.issue.index.ThreadLocalSearcherCache$Cache.retrieveEntitySearcher(ThreadLocalSearcherCache.java:116) at com.atlassian.jira.issue.index.ThreadLocalSearcherCache.getSearcher(ThreadLocalSearcherCache.java:39) at com.atlassian.jira.issue.index.DefaultIndexManager.getEntitySearcher(DefaultIndexManager.java:888) at com.atlassian.jira.issue.index.DefaultIndexManager.getIssueSearcher(DefaultIndexManager.java:865) ... 2 filtered at java.lang.reflect.Method.invoke(Method.java:498) at com.atlassian.jira.config.component.SwitchingInvocationHandler.invoke(SwitchingInvocationHandler.java:38) at com.sun.proxy.$Proxy14.getIssueSearcher(Unknown Source) at com.atlassian.jira.issue.search.SearchProviderFactoryImpl.getSearcher(SearchProviderFactoryImpl.java:17) at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.getIssueSearcher(LuceneSearchProvider.java:130) at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.search(LuceneSearchProvider.java:314) at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.search(LuceneSearchProvider.java:150) at script_f8538a4b_e4fa_4209_af87_bf572dd9a0b5_800573999.run(script_f8538a4b_e4fa_4209_af87_bf572dd9a0b5.800573999.groovy:60) at ru.mail.jira.plugins.groovy.impl.ScriptServiceImpl.doExecuteScript(ScriptServiceImpl.java:250) at ru.mail.jira.plugins.groovy.impl.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:98) ... 2 filtered at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at ru.mail.jira.plugins.groovy.util.cl.WithPluginLoaderInterceptor.invoke(WithPluginLoaderInterceptor.java:19) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) at com.sun.proxy.$Proxy3119.executeScript(Unknown Source) at ru.mail.jira.plugins.groovy.impl.cf.FieldValueExtractor.doExtractValue(FieldValueExtractor.java:163) at ru.mail.jira.plugins.groovy.impl.cf.FieldValueExtractor.lambda$getCachedValue$1(FieldValueExtractor.java:138) at com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$14(BoundedLocalCache.java:2029) at java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1892) at com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2027) at com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2010) at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:113) at com.github.benmanes.caffeine.cache.LocalManualCache.get(LocalManualCache.java:54) at ru.mail.jira.plugins.groovy.impl.cf.FieldValueExtractor.getCachedValue(FieldValueExtractor.java:132) at ru.mail.jira.plugins.groovy.impl.cf.FieldValueExtractor.extractValueHolder(FieldValueExtractor.java:91) at ru.mail.jira.plugins.groovy.impl.cf.FieldValueExtractor.extractValueHolder(FieldValueExtractor.java:79) at ru.mail.jira.plugins.groovy.impl.cf.FieldValueExtractor.extractValue(FieldValueExtractor.java:63) at ru.mail.jira.plugins.groovy.impl.cf.ScriptedCFType.getValueFromIssue(ScriptedCFType.java:50) at com.atlassian.jira.issue.fields.ImmutableCustomField.getValue(ImmutableCustomField.java:350) at com.atlassian.jira.issue.index.indexers.impl.NumberCustomFieldIndexer.addDocumentFields(NumberCustomFieldIndexer.java:44) at com.atlassian.jira.issue.index.indexers.impl.NumberCustomFieldIndexer.addDocumentFieldsSearchable(NumberCustomFieldIndexer.java:36) at com.atlassian.jira.issue.index.indexers.impl.AbstractCustomFieldIndexer.addIndex(AbstractCustomFieldIndexer.java:40) at com.atlassian.jira.issue.index.indexers.FieldIndexerWithStats.addIndex(FieldIndexerWithStats.java:54) at com.atlassian.jira.issue.index.DefaultIssueDocumentFactory$Builder.add(DefaultIssueDocumentFactory.java:93) at com.atlassian.jira.issue.index.DefaultIssueDocumentFactory$Builder.addAll(DefaultIssueDocumentFactory.java:83) at com.atlassian.jira.issue.index.DefaultIssueDocumentFactory.apply(DefaultIssueDocumentFactory.java:51) at com.atlassian.jira.issue.index.DefaultIssueDocumentFactory.apply(DefaultIssueDocumentFactory.java:32) at com.atlassian.jira.issue.index.DefaultIssueIndexer$DefaultDocumentCreationStrategy.get(DefaultIssueIndexer.java:618) at com.atlassian.jira.issue.index.DefaultIssueIndexer.lambda$reindexIssues$1(DefaultIssueIndexer.java:215) at com.atlassian.jira.issue.index.DefaultIssueIndexer.lambda$null$2(DefaultIssueIndexer.java:365) at com.atlassian.jira.index.SimpleIndexingStrategy.apply(SimpleIndexingStrategy.java:7) at com.atlassian.jira.index.SimpleIndexingStrategy.apply(SimpleIndexingStrategy.java:5) at com.atlassian.jira.issue.index.DefaultIssueIndexer.lambda$perform$3(DefaultIssueIndexer.java:363) at com.atlassian.jira.util.collect.CollectionUtil.foreach(CollectionUtil.java:39) at com.atlassian.jira.issue.util.IssueGVsIssueIterable.foreach(IssueGVsIssueIterable.java:28) at com.atlassian.jira.issue.index.DefaultIssueIndexer.perform(DefaultIssueIndexer.java:335) at com.atlassian.jira.issue.index.DefaultIssueIndexer.reindexIssues(DefaultIssueIndexer.java:211) at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexIssues(DefaultIndexManager.java:593) at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexIssues(DefaultIndexManager.java:568) at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexIssues(DefaultIndexManager.java:427) at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexIssueObjects(DefaultIndexManager.java:453) ... 2 filtered at java.lang.reflect.Method.invoke(Method.java:498) at com.atlassian.jira.config.component.SwitchingInvocationHandler.invoke(SwitchingInvocationHandler.java:38) at com.sun.proxy.$Proxy14.reIndexIssueObjects(Unknown Source) ... 2 filtered at java.lang.reflect.Method.invoke(Method.java:498) at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26) at com.sun.proxy.$Proxy14.reIndexIssueObjects(Unknown Source) ... 2 filtered at java.lang.reflect.Method.invoke(Method.java:498) at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:131) at com.sun.proxy.$Proxy14.reIndexIssueObjects(Unknown Source) at com.atlassian.greenhopper.service.IssueIndexServiceImpl.reIndexIssues(IssueIndexServiceImpl.java:112) at com.atlassian.greenhopper.service.IssueIndexServiceImpl.reindexIssueAndSubtasks(IssueIndexServiceImpl.java:196) at com.atlassian.greenhopper.service.lexorank.balance.LexoRankBalancer$IndexingRunnable.run(LexoRankBalancer.java:563) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
- relates to
-
JRASERVER-69817 Bitbucket integration triggers event handling JiraEventExecutorFactory thread without JiraThreadLocalUtil/OffRequestThreadExecutor
- Closed
-
JRASERVER-69604 DevStatus plugin triggers issue reindex in non-Jira thread without JiraThreadLocalUtil/OffRequestThreadExecutor
- Closed
-
DEVHELP-2895 Loading...
-
DEVHELP-3147 Loading...
- is related to
-
SIN-1124 Loading...