mirror of https://github.com/apache/lucene.git
SOLR-8422: When authentication enabled, requests fail if sent to a node that doesn't host
the collection git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1721142 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7c55b295c3
commit
0afacabbcd
|
@ -286,6 +286,9 @@ Bug Fixes
|
|||
* SOLR-8015: HdfsLock may fail to close a FileSystem instance if it cannot immediately
|
||||
obtain an index lock. (Mark Miller)
|
||||
|
||||
* SOLR-8422: When authentication enabled, requests fail if sent to a node that doesn't host
|
||||
the collection (noble)
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -219,8 +219,9 @@ public class SolrDispatchFilter extends BaseSolrFilter {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
HttpSolrCall call = getHttpSolrCall((HttpServletRequest) request, (HttpServletResponse) response, retry);
|
||||
ExecutorUtil.setServerThreadFlag(Boolean.TRUE);
|
||||
try {
|
||||
Action result = call.call();
|
||||
switch (result) {
|
||||
|
@ -236,6 +237,7 @@ public class SolrDispatchFilter extends BaseSolrFilter {
|
|||
}
|
||||
} finally {
|
||||
call.destroy();
|
||||
ExecutorUtil.setServerThreadFlag(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -255,8 +255,15 @@ public class ExecutorUtil {
|
|||
|
||||
private static final ThreadLocal<Boolean> isServerPool = new ThreadLocal<>();
|
||||
|
||||
/// this tells whether a thread is owned/run by solr or not.
|
||||
public static boolean isSolrServerThread() {
|
||||
return Boolean.TRUE.equals(isServerPool.get());
|
||||
}
|
||||
|
||||
public static void setServerThreadFlag(Boolean flag) {
|
||||
if (flag == null) isServerPool.remove();
|
||||
else isServerPool.set(flag);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue