SOLR-9763: Remove the workaround implemented for HADOOP-12767 (Kevin Risden)

Signed-off-by: Kevin Risden <krisden@apache.org>
This commit is contained in:
Kevin Risden 2019-02-23 10:14:44 -05:00
parent fe5a96a284
commit 9e7ec87f23
No known key found for this signature in database
GPG Key ID: 040FAE3292C5F73F
3 changed files with 4 additions and 29 deletions

View File

@ -101,6 +101,7 @@ Other Changes
* SOLR-12753: Async logging ring buffer and OOM error. When very long messages are written (1M messages or so),
it can produce an OOM error. Log messages are truncated at 10K via configuration in the log4j2.xml files.
* SOLR-9763: Remove the workaround implemented for HADOOP-12767 (Kevin Risden)
================== 8.0.0 ==================

View File

@ -29,7 +29,6 @@ import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import org.apache.curator.RetryPolicy;
import org.apache.curator.framework.AuthInfo;
@ -103,18 +102,6 @@ public class DelegationTokenKerberosFilter extends DelegationTokenAuthentication
@Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain filterChain) throws IOException, ServletException {
// HttpClient 4.4.x throws NPE if query string is null and parsed through URLEncodedUtils.
// See HTTPCLIENT-1746 and HADOOP-12767
HttpServletRequest httpRequest = (HttpServletRequest)request;
String queryString = httpRequest.getQueryString();
final String nonNullQueryString = queryString == null ? "" : queryString;
HttpServletRequest requestNonNullQueryString = new HttpServletRequestWrapper(httpRequest){
@Override
public String getQueryString() {
return nonNullQueryString;
}
};
// include Impersonator User Name in case someone (e.g. logger) wants it
FilterChain filterChainWrapper = new FilterChain() {
@Override
@ -136,7 +123,7 @@ public class DelegationTokenKerberosFilter extends DelegationTokenAuthentication
// A hack until HADOOP-15681 get committed
Locale.setDefault(Locale.US);
super.doFilter(requestNonNullQueryString, response, filterChainWrapper);
super.doFilter(request, response, filterChainWrapper);
}
@Override

View File

@ -27,7 +27,6 @@ import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import org.apache.curator.RetryPolicy;
import org.apache.curator.framework.AuthInfo;
@ -79,18 +78,6 @@ public class HadoopAuthFilter extends DelegationTokenAuthenticationFilter {
@Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain filterChain) throws IOException, ServletException {
// HttpClient 4.4.x throws NPE if query string is null and parsed through URLEncodedUtils.
// See HTTPCLIENT-1746 and HADOOP-12767
HttpServletRequest httpRequest = (HttpServletRequest)request;
String queryString = httpRequest.getQueryString();
final String nonNullQueryString = queryString == null ? "" : queryString;
HttpServletRequest requestNonNullQueryString = new HttpServletRequestWrapper(httpRequest){
@Override
public String getQueryString() {
return nonNullQueryString;
}
};
// include Impersonator User Name in case someone (e.g. logger) wants it
FilterChain filterChainWrapper = new FilterChain() {
@Override
@ -112,7 +99,7 @@ public class HadoopAuthFilter extends DelegationTokenAuthenticationFilter {
// A hack until HADOOP-15681 get committed
Locale.setDefault(Locale.US);
super.doFilter(requestNonNullQueryString, response, filterChainWrapper);
super.doFilter(request, response, filterChainWrapper);
}
@Override
@ -232,4 +219,4 @@ public class HadoopAuthFilter extends DelegationTokenAuthenticationFilter {
return ret;
}
}
}
}