Looks fine mostly. Some nits:

58 // - SocketTimeoutException may occur in MAC because it will not throw

s/in MAC/on Mac/.

66 + "occured or PortUnreachableException not thrown by the "

s/or/which means/.

  76                 File f = new File("unreachable.krb5.conf");
77 System.setProperty("java.security.krb5.conf", f.getPath());

How is this better than just set the property value to "unreachable.krb5.conf"?

Thanks
Max

On 8/29/2016 20:32, Sibabrata Sahoo wrote:
Hi Max,

Please find the updated webrev addressing all comments bellow: 
http://cr.openjdk.java.net/~ssahoo/8015595/webrev.01/

Thanks,
Siba

-----Original Message-----
From: Weijun Wang
Sent: Monday, August 29, 2016 6:36 AM
To: Sibabrata Sahoo; security-dev@openjdk.java.net
Subject: Re: [9] RFR: 8015595: Test sun/security/krb5/auto/Unreachable.java 
fails with Timeout error

Several comments:

1. findPortUnreachableExc() can be put outside of the Future and called 
directly.

2. When a TimeoutException is caught from future.get(), I think this should be 
treated as a failure. We have already used
findPortUnreachableExc() to confirm PUE is available on this system and that 
port is not used by another process. If we still see timeout, it should be 
investigated. In fact, if the test succeeds in this case, it will never fail. 
Right?

3. Why not write 2 catch blocks here for each exception type?

  120         } catch (SocketTimeoutException | PortUnreachableException
e) {
  121             if (e instanceof PortUnreachableException) {
  122                 return true;
  123             }
  124         }

Thanks
Max

On 8/26/2016 18:39, Sibabrata Sahoo wrote:
Hi,



Here is the latest webrev:
http://cr.openjdk.java.net/~ssahoo/8015595/webrev.00/



I have updated the test with these additional support,

1)      Verifying, if the port is reachable or PortUnreachableException
is supported by the platform, otherwise the Test will terminate itself
with warning.

2)      Removed the test from ProblemList.txt for MAC OS because of #1.

3)      Uses only one KDC port in the configuration file.

4)      Removed static "unreachable.krb5.conf" as the Test creates the
file during runtime.



Thanks,

Siba



*From:*Sibabrata Sahoo
*Sent:* Wednesday, August 24, 2016 9:46 PM
*To:* Weijun Wang; security-dev@openjdk.java.net
*Subject:* [9] RFR: 8015595: Test
sun/security/krb5/auto/Unreachable.java fails with Timeout error



Hi,



Please review the patch for "sun/security/krb5/auto/Unreachable.java
fails with Timeout error"



JBS: https://bugs.openjdk.java.net/browse/JDK-8015595

Webrev: http://cr.openjdk.java.net/~ssahoo/8015595/webrev.00/



Description:

When a KDC port is unreachable, Kerberos login module depends on
PortUnreachableException to exit immediately. But as per JavaDoc for
receive() in "java.net.DatagramSocket", the PortUnreachableException
is not guaranteed. In such case the Login module waits for 90 second
by default. But the JTREG Test timeout has been set for 10 second and
because of that the Test gets timeout.



Since the "intermittent" failure is unavoidable due to
"PortUnreachableException is not guaranteed", I have provided a fix to
print a warning message for such cases instead of making the Test timeout.



Thanks,

Siba



Reply via email to