Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-8434

Use shared instance of CollectionTerminatedException

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • None
    • None
    • None
    • None
    • New

    Description

      Creating exceptions and filling in the stack is expensive (see SOLR-11242 and SOLR-11314 for two such examples). CollectionTerminatedException is used as a signaling mechanism - there are zero instances in code that actually log that it occurred or make use of anything other than the fact that it occurred (unlike Solr's EarlyTerminatingCollectorException, for instance). Exceptions really should be for something exceptional - the use of CollectionTerminatedException is in place of polluting return values with this condition and is just used as a signal to callers.

      Because CollectionTerminatedException is never inspected directly and is effectively a different return condition, it doesn't make as much sense to generate new Exceptions with fresh stack traces every time - either change the signatures or share the object.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mbraun688 Michael Braun
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: