Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Getting SearchUnavailableException during reindexing if custom field has JQL search

Tuncay Senturk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 12, 2015

Hi there,

I have calculated custom fields in which I perform JQL search using SearchProvider.

During JIRA reindexing this service is unavailable and gets SearchUnailableExceptio after 30 seconds.

Here is the cause of the exception 

com.atlassian.jira.issue.index.IndexException: 
Wait attempt timed out - waited 30000 milliseconds.

I think this behaviour is caused by after JIRA 6.3.x enhancements.

What I wonder is, is this by design or just a bug? What should I do?

I can implement EventListener in which I can listen ReindexCompletedEvent and trigger reindex for those issues. But I am not sure that this is the right thing to do. it might have bad effect on performance.

Any suggestion or guide will be much appreciated.

Tuncay

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 13, 2015

Tuncay, this has come up before. You're right that it's a change in 6.3. At some point I will add some defensive code for this, along the lines of what you are suggesting. I suspect there is an existing issue.

I don't think it will have an effect on performance... all that will happen is that just the script fields that use a jql search on just the issues in its context, will have that value reindexed.

Tuncay Senturk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 13, 2015

Thanks for reply Jamie, I almost finished implementation, but in my case I tried to reindex issues, not contexts. So the issues which have custom field that has JQL search will be reindexed again. This is the performance issue. However I did not know reindexing context. Thanks for the light. I need to research on reindexing context.

Tuncay Senturk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 13, 2015

But the point is, if this is a bug than our effort on fixing the problem is really annoying. But if it is by design, then how are we supposed to know it before customers raise issues? It is annoying as well.

Tuncay Senturk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 14, 2015

Hi Jamie, As I mentioned, I succeeded re-reindexing those issues without getting SearchUnavailableException. This has two downsides : 1. From the console logs and within the UI it shows as 99% issues reindexed, however the process may continue in a time slot may be much more than 1%, depending on the count of issues that have custom field using JQL search. 2. I am selecting to re-reindex those issues that have custom fields ( fields with using JQL search). But I could not find any API to reindex issue for just the value of the custom field. So, when reindexing issue, it reindexes all fields/custom fields. For instance if 10 custom fields defined, and only one field is using JQL, in the process of re-reindexing other nine custom fields will be reindexing again, which will affect on performance. Is there any way to just index a custom field value like in the {{CustomFieldIndexer}}? I know you can write your own indexer, and I have a couple of them but Lucene {{Document}} is passed to this method, but in this case I have no {{Document}} and I am really stuck at this point. I hope I am clear Tuncay

TAGS
AUG Leaders

Atlassian Community Events