[ 
https://issues.apache.org/jira/browse/HADOOP-10590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benoy Antony updated HADOOP-10590:
----------------------------------

    Attachment: performancetest.patch

Attaching the class  using which I ran the performance tests
Here an RPC server is created with 10 different protocol classes. The different 
protocols are required to cause simultaneous connection requests.
The server sets acls on porticols such that authorization always fails. If any 
authorization is successful, then the successful connection will be cached and 
will not invoke authorize () again.

The server is started with 4 reader threads and 4 handler threads. 
10 client threads are started. Each of the threads make 1000 calls 
simultaneously. 
The above is repeated 10 times and the total duration for each iteration is 
recorded and average is also calculated.
The tests are executed on 2.6 GHz Intel Core i7 (8 core) , 16 GB 1600 MHz DDR3. 
 Set log level to Error to remove any logging.
The readings on  for the following conditions are below:

{panel:title=current code}
The different times in milliseconds are: 
7350 , 23234 , 30897 , 18634 , 32112 , 18905 , 35371 , 16758 , 32161 , 22113  . 
 
The average time in milliseconds is: 23754
{panel}

{panel:title=synchronized authorize}
The different times in milliseconds are: 
6101 , 25809 , 26170 , 22700 , 28617 , 24078 , 28440 , 23569 , 27246 , 25882  . 
 The average time in milliseconds is: 23861
{panel}

{panel:title=volatile protocolToAcl}
The different times in milliseconds are: 
7256 , 25995 , 29741 , 19679 , 30089 , 22581 , 27695 , 22877 , 27267 , 23630  . 
 The average time in milliseconds is: 23681
{panel}

Observations:  There are no noticeable difference between 
unsynchronized/synchronized/volatile cases. Triggering the exception 
(AuthorizationException) , may be expensive and hence differences between 
unsynchronized/synchronized/volatile becomes negligible compared to the 
exception operations.

> ServiceAuthorizationManager  is not threadsafe
> ----------------------------------------------
>
>                 Key: HADOOP-10590
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10590
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 2.4.0
>            Reporter: Benoy Antony
>            Assignee: Benoy Antony
>         Attachments: HADOOP-10590.patch, performancetest.patch
>
>
> The mutators in ServiceAuthorizationManager  are synchronized. The accessors 
> are not synchronized.
> This results in visibility issues when  ServiceAuthorizationManager's state 
> is accessed from different threads.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to