-
Bug
-
Resolution: Fixed
-
Medium
-
8.2.1
-
8.02
-
11
-
Severity 2 - Major
-
3
-
Issue Summary
We have a CalculatedCFType which uses Jira search API. It errors when re-index is triggered by devstatus threads.
We've seen such errors with these thread pools: devstatus.dvcs.github:thread- and devstatus.applink:thread-
Steps to Reproduce
- Extend CalculatedCFType to accept scripts
- Call com.atlassian.jira.issue.search.SearchProvider#search
- Trigger a re-index by devstatus plugin
Expected Results
The devstatus plugin runs tasks that re-index issues in non-jira threads with Jira thread local context
Actual Results
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 script1560494574091800573999.run(script1560494574091800573999.groovy:60) at ru.mail.jira.plugins.groovy.impl.ScriptServiceImpl.doExecuteScript(ScriptServiceImpl.java:251) at ru.mail.jira.plugins.groovy.impl.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:97) ... 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.$Proxy3098.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:1853) 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.$Proxy287.reIndexIssueObjects(Unknown Source) ... 2 filtered at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56) at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70) at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) at com.sun.proxy.$Proxy3548.reIndexIssueObjects(Unknown Source) at com.atlassian.jira.plugin.devstatus.provider.source.cache.DevSummaryStore.reIndex(DevSummaryStore.java:107) at com.atlassian.jira.plugin.devstatus.provider.source.cache.CachingProviderDecorator$StoreValueInCache.apply(CachingProviderDecorator.java:336) at com.atlassian.jira.plugin.devstatus.provider.source.cache.CachingProviderDecorator.lambda$fetchSummaryData$1(CachingProviderDecorator.java:231) at com.google.common.util.concurrent.AbstractTransformFuture$TransformFuture.doTransform(AbstractTransformFuture.java:233) at com.google.common.util.concurrent.AbstractTransformFuture$TransformFuture.doTransform(AbstractTransformFuture.java:223) at com.google.common.util.concurrent.AbstractTransformFuture.run(AbstractTransformFuture.java:110) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:398) at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1029) at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:871) at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:694) at com.google.common.util.concurrent.AbstractTransformFuture$TransformFuture.setResult(AbstractTransformFuture.java:238) at com.google.common.util.concurrent.AbstractTransformFuture.run(AbstractTransformFuture.java:155) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:398) at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1029) at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:871) at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:694) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.afterRanInterruptibly(TrustedListenableFutureTask.java:131) at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:80) at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78) 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)
Notes
- Jira version is 8.2.1, originally reported to Jira support in GHS-155435
Workaround
Currently, there is no known workaround for this behavior. A workaround will be added here when available.
- is related to
-
JRASERVER-69726 Jira Software triggers issue reindex in non-Jira thread without JiraThreadLocalUtil/OffRequestThreadExecutor
- Closed
-
JRASERVER-71033 Email subscription triggers search issue in non-Jira thread without JiraThreadLocalUtil/OffRequestThreadExecutor
- Gathering Impact
-
DEVHELP-2985 Loading...
-
SIN-1124 Loading...
- relates to
-
JRASERVER-69817 Bitbucket integration triggers event handling JiraEventExecutorFactory thread without JiraThreadLocalUtil/OffRequestThreadExecutor
- Closed
-
JRASERVER-71091 Development Activity breaks Sprint indexes
- Closed
-
GHS-155435 Loading...
-
JSEV-2705 Loading...
-
DEVHELP-3147 Loading...
- mentioned in
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...
-
Page Loading...