RFR 8046588: test for SO_FLOW_SLA availability does not check for EACCESS

Michael McMahon michael.x.mcmahon at oracle.com
Thu Jun 12 19:15:24 UTC 2014


On 12/06/14 18:47, Alan Bateman wrote:
> On 12/06/2014 18:04, Michael McMahon wrote:
>> Could I get this change reviewed please?
>>
>> We need to check if the current process has permission to use the 
>> SO_FLOW_SLA
>> socket option as well as test if the feature is installed.
>>
>> The problem would cause the new test to fail on Solaris machines with 
>> S11.2
>> unless running with the required privilege.
>>
>> http://cr.openjdk.java.net/~michaelm/8046588/webrev.1/
>>
>> This change also needs to be backported to 8u20.
> I can see that this helps the tests but I just wonder if this might be 
> confusing to someone that attempts to use this socket option but 
> forgets to run with privileges. In that case then then methods such as 
> Socket#setOption will UnsupportedOperationException whereas throwing 
> IOException with a somewhat useful message as it does not might be 
> better.
>
> Would it be better to just change the test to handle the access denied 
> instead?
>
> -Alan.

It would be possible to change the error back, but what about 
supportedOptions() - what should
that return? It doesn't seem right that it would include an option that 
cannot be used and how do
we test it, if we can't tell whether the option is usable or not?

Maybe it depends on how these privileges get configured, which is 
something I'm looking into,
but if it's a case that specific user attributes need to be configured 
on a system, then I'm not sure
we can count on that for our test systems.

Michael


More information about the net-dev mailing list