ranger-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pradeep Agrawal (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (RANGER-863) Make parameters like maxHttpHeaderSize configurable for EmbeddedServer
Date Thu, 03 Mar 2016 05:32:18 GMT

    [ https://issues.apache.org/jira/browse/RANGER-863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15177218#comment-15177218
] 

Pradeep Agrawal commented on RANGER-863:
----------------------------------------

**Problem Statement :**
Parameters like maxHttpHeaderSize are not configurable in EmbeddedServer used by Ranger and
RangerKMS.
This ability is required to handle large header requests in kerberised (when ticket size is
large) environment for Ranger KMS as well as Ranger Admin.
**Proposed Solution :**
Attached patch contains changes in EmbeddedServer.java file which is being used to start tomcat
service after instantiating the connector. In ranger-admin-site.xml/kms-site.xml properties
file, tomcat attributes can be added with prefix ranger.service.http.connector.property.,
Where ranger.service.http.connector.property.<tomcat-attribute> shall be the property
name and value tag can have valid value allowed in tomcat connector.
For example : An entry for maxHttpHeaderSize attribute in ranger-admin-site would be :
<property>
                <name>ranger.service.http.connector.property.maxHttpHeaderSize</name>
                <value>81920</value>
</property>
Similarly below given connector properties can be configured :
acceptCount
acceptorThreadCount
connectionTimeout
keepAliveTimeout
maxConnections
maxHttpHeaderSize
maxKeepAliveRequests
maxThreads
compression
Also there are few attributes which can't be overridden using above mentioned approach as
tomcat has separate setter method to override those attribute values. For these attributes
we will use prefix ranger.service.http.connector.attrib., but only below mentioned attribute
shall be supported in this approach as of now.
allowTrace
asyncTimeout
enableLookups
maxHeaderCount
maxParameterCount
maxPostSize
maxSavePostSize
methods
I have implemented both approaches to override the default value of above attributes and the
other properties also which can be configured through setProperty() method of Connector class.
**Testing done :**
*Steps performed (with patch) :*
1. After Ranger installation, started Ranger admin and tried a REST call with huge HTTP header
size.
curl -i -u admin:admin -H "X-LongHeader: $(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w
8192 | head -n 1)" http://localhost:6080/service/users/1
2. After above request got below given response from server
HTTP/1.1 400 Bad Request
Server: Apache-Coyote/1.1
Transfer-Encoding: chunked
Date: Thu, 03 Mar 2016 04:49:20 GMT
Connection: close
and below given log was observed in catalina.out
INFO: Error parsing HTTP request header
3. Now to solve above issue stopped the Ranger admin and configured property for maxHttpHeaderSize
attribute in ranger-admin-site.xml and then restart the Ranger admin.
<property>
                <name>ranger.service.http.connector.property.maxHttpHeaderSize</name>
                <value>81920</value>
</property>
4. Tried above mentioned REST call again and got the Response code '200 OK' along with expected
output.

> Make parameters like maxHttpHeaderSize configurable for EmbeddedServer 
> -----------------------------------------------------------------------
>
>                 Key: RANGER-863
>                 URL: https://issues.apache.org/jira/browse/RANGER-863
>             Project: Ranger
>          Issue Type: Bug
>          Components: admin
>    Affects Versions: 0.5.0
>            Reporter: Gautam Borad
>            Assignee: Pradeep Agrawal
>             Fix For: 0.6.0
>
>         Attachments: RANGER-863-1.patch
>
>
> *PROBLEM STATEMENT*
> Parameters like maxHttpHeaderSize are not configurable in EmbeddedServer used by Ranger
and RangerKMS. 
> This ability is required to handle large header requests in kerberised (when ticket size
is large) environment for Ranger KMS as well as Ranger Admin. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message