Github user jhuynh1 commented on a diff in the pull request: https://github.com/apache/geode/pull/451#discussion_r111275346 --- Diff: geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/distributed/LuceneQueryFunction.java --- @@ -132,6 +133,25 @@ private LuceneIndexImpl getLuceneIndex(final Region region, try { index = (LuceneIndexImpl) service.getIndex(searchContext.getIndexName(), region.getFullPath()); + if (index == null && service instanceof LuceneServiceImpl) { + if (((LuceneServiceImpl) service).getDefinedIndex(searchContext.getIndexName(), + region.getFullPath()) != null) { + // The node may be in the process of recovering, where we have the index defined but yet + // to be recovered + // If we retry fast enough, we could get a stack overflow based on the way function + // execution is currently written + // Instead we will add an artificial sleep to slow down the retry at this point + // Hopefully in the future, the function execution would retry without adding to the stack + // and this can be removed + try { --- End diff -- This is really an artificial time that was to avoid the stack overflow from the function execution retry. The smaller the time, the greater chance we hit the stack overflow but also the quicker we return to the user if the index really doesn't exist. I can understand maybe bumping this up to a second but 10 seems a bit long...
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---