Uploaded image for project: 'FishEye'
  1. FishEye
  2. FE-5736

Review indexer should be started as a part of the context startup, not afterwards to avoid race conditions

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Low
    • None
    • 2.4.0, 3.9.0
    • None
    • None

    Description

      Summary

      When the application is starting up, the Spring context starts, but the review indexer is started afterwards. (see Run#mainImpl()).
      Requests that use the indexer will return with a 'Indexer is stopped' error before that happens (which should usually be a few seconds at most).

      Expected Results

      The indexer starts as a part of the Spring context startup, and no errors are logged

      Actual Results

      The below exception is thrown in the atlassian-fisheye-YYYY-MM-DD.log file:

      2016-02-26 12:03:20,000 ERROR [qtp458872080-139 ] fisheye TotalityFilter-logExceptionDetails - Exception "Indexer is stopped (com.atlassian.crucible.activity.lucene.DefaultReviewItemIndexer@56a5e7fb)" (java.lang.IllegalStateException) while processing "/rest/remote-link-aggregation/latest/aggregation" (Referer:"null")
      java.lang.IllegalStateException: Indexer is stopped (com.atlassian.crucible.activity.lucene.DefaultReviewItemIndexer@56a5e7fb)
      	at com.atlassian.crucible.activity.lucene.DefaultReviewItemIndexer.checkStatus(DefaultReviewItemIndexer.java:374)
      	at com.atlassian.crucible.activity.lucene.DefaultReviewItemIndexer.withIndexSearcher(DefaultReviewItemIndexer.java:745)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      

      The stacktrace above appears after the Spring context start:

      2016-02-26 12:03:10,000 INFO  [main ] org.eclipse.jetty.server.Server Server-doStart - jetty-8.1.10.v20130312
      2016-02-26 12:03:10,001 INFO  [main ] / ContextHandler$Context-log - Initializing Spring root WebApplicationContext
      

      And the Review indexer start:

      2016-02-26 12:03:20,000 INFO  [main ] fisheye Run-mainImpl - Server started on :8060 (http) (control port on 127.0.0.1:8059)
      2016-02-26 12:03:20,001 INFO  [qtp458872080-137 ] com.sun.jersey.server.impl.application.WebApplicationImpl WebApplicationImpl-_initiate - Initiating Jersey application, version 'Jersey: 1.8-atlassian-14 04/30/2014 06:01 PM'
      2016-02-26 12:03:20,002 INFO  [qtp458872080-137 ] com.sun.jersey.server.impl.application.WebApplicationImpl WebApplicationImpl-_initiate - Initiating Jersey application, version 'Jersey: 1.8-atlassian-14 04/30/2014 06:01 PM
      

      Notes

      The error can be safely ignored.
      It only occurs if a request using the indexer is triggered, so it may not be available after every start of the application.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lpater Lukasz Pater
              Votes:
              4 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated: