madrob commented on a change in pull request #230:
URL: https://github.com/apache/solr/pull/230#discussion_r675200608



##########
File path: solr/core/src/java/org/apache/solr/search/facet/UnInvertedField.java
##########
@@ -605,80 +605,14 @@ public static UnInvertedField getUnInvertedField(String 
field, SolrIndexSearcher
     if (cache == null) {
       return new UnInvertedField(field, searcher);
     }
-    AtomicReference<Throwable> throwableRef = new AtomicReference<>();
-    UnInvertedField uif = cache.computeIfAbsent(field, f -> {
-      UnInvertedField newUif;
-      try {
-        newUif = new UnInvertedField(field, searcher);
-      } catch (Throwable t) {
-        throwableRef.set(t);
-        newUif = null;
-      }
-      return newUif;
-    });
-    if (throwableRef.get() != null) {
-      rethrowAsSolrException(field, throwableRef.get());
+    try {
+      return cache.computeIfAbsent(field,
+        (IOFunction<? super String, ? extends UnInvertedField>) f -> new 
UnInvertedField(field, searcher)
+      );
+    } catch (IOException e) {
+      // Do we still need this, computeIfAbsent can throw IOException for us 
directly
+      throw new SolrException(ErrorCode.SERVER_ERROR, "Exception occurred 
during uninverting " + field, e);

Review comment:
       This is inconsistent with the non-cache case.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to