Brian Burkhalter | 19 Mar 15:30 2015
Picon

[9] RFR of 8074937: ServerSocket.accept() API Descriptions should include past tense

Please review at your convenience. This a doc-only change.

Issue: https://bugs.openjdk.java.net/browse/JDK-8074937
Patch: http://cr.openjdk.java.net/~bpb/8074937/webrev.00/

This is in effect an amplification of extant javadoc suggested as an enhancement by an external user. I performed some testing to verify the accuracy of the suggested documentation change prior to crafting the verbiage, and the criticism does seem to be well-founded in the behavior of the APIs in question.

It would be good however if someone with a more profound knowledge of this area were to review the proposed documentation update for accuracy, especially as it is not unlikely that there might be platform-specific behavior with which these statements conflict.

Thanks,

Brian
Rob McKenna | 19 Mar 00:27 2015
Picon

RFR: 8075039: (sctp) com/sun/nio/sctp/SctpMultiChannel/SendFailed.java fails on Solaris only

Hi folks,

Mistakenly neglected to exclude Solaris from testing:

http://cr.openjdk.java.net/~robm/8075039/webrev.01/

     -Rob

Michael McMahon | 9 Mar 17:27 2015
Picon

HTTP 2 client API

Hi,

JEP 110 HTTP 2 client

in JDK 9, is defining and implementing a new API for HTTP which also 
supports
the new HTTP version 2 that has recently been working its way through 
the IETF.
The work also includes support for websockets (RFC 6455).

In fact, the majority of the API is agnostic about the HTTP protocol 
version, with only minor
configuration settings, and support for multiple responses (Http server 
push) having any direct impact.

The HTTP API is defined around three main types (HttpClient, which is 
the central
point for configuration of SSL, executor service cookie management etc), 
HttpRequest
and HttpResponse (which should be self explanatory).

Requests are sent/received either synchronously (blocking) or in a 
non-blocking (asynchronous)
mode using java.util.future.CompletableFuture which is a powerful new 
framework for
asynchronous execution introduced in JDK 8.

The API docs can be seen at the link below:

http://cr.openjdk.java.net/~michaelm/httpclient/01/

All new classes and interfaces belong to the java.net package.

A prototype implementation of this API supporting HTTP/1.1 only, is 
available and will
be uploaded into the JDK 9 sandbox forest in the coming day or two.

Comments welcome!

Thanks,
Michael.

Mark Sheppard | 4 Mar 22:53 2015
Picon

RFR: JDK-8065078 - NetworkInterface.getNetworkInterfaces() triggers intermittent test failures

Hi
    please oblige and review the following small change
http://cr.openjdk.java.net/~msheppar/8065078/webrev/

to address the issue raised in
https://bugs.openjdk.java.net/browse/JDK-8065078

the getAdapters and getAdpater functions were amended in
to add additional diagnostic of the error code, in the event of a
failure, following the second invocation of GetAdpatersAddresses in the 
call flows.
This has shown that the  ERROR_BUFFER_OVERFLOW (i.e. 111)
can occur even though the buffer, to hold the addresses, has been realloced
to the size as per that returned in the variable len
from the initial GetAdapatersAddresses. Thus, it is possible to have a 
"race condition" where
configuration changes are taking place simultaneously to
the NetworkInterface.getNetworkInterfaces() call

The proposed change increases the initial size of the addresses buffer 
to 4096,
and in the event of a failure increases the returned buffer size by this 
amount again.

Additionally, the update of the static variable bufsize, after the 
realloc, was seen as potentially problematic
and has thread safe implications, so these updates have been removed. 
The shared variable is not protected
by a mutex during read and write of variable.

regards
Mark

Seán Coffey | 27 Feb 12:37 2015
Picon

RFR : 8072384 : Setting IP_TOS on java.net sockets not working on unix

It looks like setting and getting the IP_TOS values on the java.net 
Sockets is currently broken for some scenarios. It's not possible to set 
the value on a ServerSocket via the jdk.net.Sockets.setOption API. See 
below for a webrev I'm proposing. It basically makes best efforts to set 
the IP_TOS value by mapping it to the IPV6_TCLASS option in an IPV6 
enabled environment. NIO follows a similar approach.

Some of the comments in NET_SetSockOpt seem to be legacy and I've 
removed the no-op that was in place for IP_TOS. A corner case of setting 
of IP_TOS was found on Solaris. It doesn't seem to support setting the 
value once the socket is connected. I've handled this via catching of 
exception and we should be ok with this since the spec doesn't make any 
promises in this area if the socket is connected.

I've been testing various fixes across IPv4/v6 sockets on Solaris, Linux 
and macosx. So far, the proposed changes seem to work and wireshark 
traces help to confirm that TOS/TCLASS values are being set.

I still need to see if I can improve the getOpt logic for IP_TOS. At the 
moment, it can return a cached value which may not represent the true 
value in place at kernel socket level. I'll also improve test coverage 
in this area.

bug report : https://bugs.openjdk.java.net/browse/JDK-8072384
webrev : http://cr.openjdk.java.net/~coffeys/webrev.8072384.jdk9.v1/webrev/

regards,
Sean.

Seán Coffey | 24 Feb 18:24 2015
Picon

RFR: 7178362: Socket impls should ignore unsupported proxy types rather than throwing

This issue relates to another bug that I own : JDK-8062305

It seems to be an area that causes alot of issue (for plugin mainly) and 
the suggestion from Chris in 7178362 bug report to return a direct 
connection type for bad ProxySelector implementations seems appropriate.

webrev : http://cr.openjdk.java.net/~coffeys/webrev.7178362/webrev/
bug report : https://bugs.openjdk.java.net/browse/JDK-7178362

regards,
Sean.

Mark Sheppard | 18 Feb 16:30 2015
Picon

RFR: JDK-8046901 - Check jdk/src/solaris/native/sun/nio for Parfait flagged uninitialized memory

Hi
    please oblige and review the following changes
http://cr.openjdk.java.net/~msheppar/8046901/webrev/

which address the parfait issues in
https://bugs.openjdk.java.net/browse/JDK-8046901

pertaining to uninitialized memory in
src/java.base/unix/native/libnio/ch/DatagramChannelImpl.c
src/java.base/unix/native/libnio/ch/ServerSocketChannelImpl.c
src/jdk.sctp/unix/native/libsctp/SctpNet.c

regards
Mark

Mark Sheppard | 18 Feb 14:19 2015
Picon

RFR: JDK-8046893 - JNI exception pending in jdk/src/solaris/native/java/net: ExtendedOptionsImpl.c, PlainDatagramSocketImpl.c

Hi
    please review the following small change
http://cr.openjdk.java.net/~msheppar/8046893/webrev/

which addresses the parfait issue in
https://bugs.openjdk.java.net/browse/JDK-8046893

regards
Mark

joe darcy | 10 Feb 00:27 2015
Picon

JDK 9 RFR of JDK-8041395: Doclint regression in java.net.SocketOption

Hello,

Please review these straightforward changes to address some doclint 
issues in java.net:

     JDK-8041395: Doclint regression in java.net.SocketOption
     http://cr.openjdk.java.net/~darcy/8041395.0/

Patch below.

Thanks,

-Joe

--- old/src/java.base/share/classes/java/net/DatagramSocket.java 
2015-02-09 15:19:25.407396706 -0800
+++ new/src/java.base/share/classes/java/net/DatagramSocket.java 
2015-02-09 15:19:25.223399019 -0800
 <at>  <at>  -1,5 +1,5  <at>  <at> 
  /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights 
reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights 
reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
 <at>  <at>  -1308,6 +1308,7  <at>  <at> 
      /**
       * Sets the value of a socket option.
       *
+     *  <at> param <T> The type of the socket option value
       *  <at> param name The socket option
       *  <at> param value The value of the socket option. A value of { <at> code 
null}
       *              may be valid for some options.
 <at>  <at>  -1342,6 +1343,7  <at>  <at> 
      /**
       * Returns the value of a socket option.
       *
+     *  <at> param <T> The type of the socket option value
       *  <at> param name The socket option
       *
       *  <at> return The value of the socket option.
--- old/src/java.base/share/classes/java/net/DatagramSocketImpl.java 
2015-02-09 15:19:25.855391074 -0800
+++ new/src/java.base/share/classes/java/net/DatagramSocketImpl.java 
2015-02-09 15:19:25.695393086 -0800
 <at>  <at>  -1,5 +1,5  <at>  <at> 
  /*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights 
reserved.
+ * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights 
reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
 <at>  <at>  -267,6 +267,7  <at>  <at> 
      /**
       * Called to set a socket option.
       *
+     *  <at> param <T> The type of the socket option value
       *  <at> param name The socket option
       *
       *  <at> param value The value of the socket option. A value of { <at> code 
null}
 <at>  <at>  -276,7 +277,7  <at>  <at> 
       *         support the option
       *
       *  <at> throws NullPointerException if name is { <at> code null}
-     *
+     *  <at> throws IOException if an I/O problem occurs while attempting to 
set the option
       *  <at> since 1.9
       */
      protected <T> void setOption(SocketOption<T> name, T value) throws 
IOException {
 <at>  <at>  -308,12 +309,15  <at>  <at> 
      /**
       * Called to get a socket option.
       *
+     *  <at> return the socket option
+     *  <at> param <T> The type of the socket option value
       *  <at> param name The socket option
       *
       *  <at> throws UnsupportedOperationException if the DatagramSocketImpl 
does not
       *         support the option
       *
       *  <at> throws NullPointerException if name is { <at> code null}
+     *  <at> throws IOException if an I/O problem occurs while attempting to 
set the option
       *
       *  <at> since 1.9
       */
--- old/src/java.base/share/classes/java/net/ServerSocket.java 
2015-02-09 15:19:26.303385442 -0800
+++ new/src/java.base/share/classes/java/net/ServerSocket.java 
2015-02-09 15:19:26.131387604 -0800
 <at>  <at>  -1,5 +1,5  <at>  <at> 
  /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights 
reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights 
reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
 <at>  <at>  -924,6 +924,7  <at>  <at> 
      /**
       * Sets the value of a socket option.
       *
+     *  <at> param <T> The type of the socket option value
       *  <at> param name The socket option
       *  <at> param value The value of the socket option. A value of { <at> code 
null}
       *              may be valid for some options.
 <at>  <at>  -957,6 +958,7  <at>  <at> 
      /**
       * Returns the value of a socket option.
       *
+     *  <at> param <T> The type of the socket option value
       *  <at> param name The socket option
       *
       *  <at> return The value of the socket option.
--- old/src/java.base/share/classes/java/net/Socket.java 2015-02-09 
15:19:26.739379961 -0800
+++ new/src/java.base/share/classes/java/net/Socket.java 2015-02-09 
15:19:26.579381972 -0800
 <at>  <at>  -1,5 +1,5  <at>  <at> 
  /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights 
reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights 
reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
 <at>  <at>  -1727,6 +1727,7  <at>  <at> 
      /**
       * Sets the value of a socket option.
       *
+     *  <at> param <T> The type of the socket option value
       *  <at> param name The socket option
       *  <at> param value The value of the socket option. A value of { <at> code 
null}
       *              may be valid for some options.
 <at>  <at>  -1758,6 +1759,7  <at>  <at> 
      /**
       * Returns the value of a socket option.
       *
+     *  <at> param <T> The type of the socket option value
       *  <at> param name The socket option
       *
       *  <at> return The value of the socket option.
--- old/src/java.base/share/classes/java/net/SocketImpl.java 2015-02-09 
15:19:27.191374279 -0800
+++ new/src/java.base/share/classes/java/net/SocketImpl.java 2015-02-09 
15:19:27.031376290 -0800
 <at>  <at>  -1,5 +1,5  <at>  <at> 
  /*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights 
reserved.
+ * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights 
reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
 <at>  <at>  -362,6 +362,7  <at>  <at> 
      /**
       * Called to set a socket option.
       *
+     *  <at> param <T> The type of the socket option value
       *  <at> param name The socket option
       *
       *  <at> param value The value of the socket option. A value of { <at> code 
null}
 <at>  <at>  -397,6 +398,7  <at>  <at> 
      /**
       * Called to get a socket option.
       *
+     *  <at> param <T> The type of the socket option value
       *  <at> param name The socket option
       *
       *  <at> return the value of the named option

Ivan Gerasimov | 6 Feb 18:48 2015
Picon

RFR 8072466: Deadlock when starting MulticastSocket and DatagramSocket

Hello!

There has been a deadlock in jdk-net code noticed on Windows.

In the bug description there's a stack snippet showing that one of the 
deadlocked threads stuck in the native initialization code of 
DualStackPlainDatagramSocketImpl and the other -- in initializing of 
TwoStacksPlainDatagramSocketImpl.

I suspect that the reason might be due to unordered initialization:
AbstractPlainDatagramSocketImpl, the parent of both classes above, 
explicitly loads TwoStacksPlainDatagramSocketImpl from the native init().
Thus, when both classes are being initialized concurrently, it may end 
with a clash.

Another issue noticed by Mark Sheppard is that the Windows version of 
DefaultDatagramSocketImplFactory.createDatagramSocketImpl() isn't 
synchronized, but reads/modifies shared data.
Thus, I removed modification and declared all the accessed fields final.

Would you please help review the proposed fix?

BUGURL: https://bugs.openjdk.java.net/browse/JDK-8072466
WEBREV: http://cr.openjdk.java.net/~igerasim/8072466/0/webrev/

The build went fine on all the platforms, all the tests from 
(net|nio|io) passed Okay.

Sincerely yours,
Ivan

Chris Hegarty | 30 Jan 14:36 2015
Picon

RFR 8064924: Update java.net.URL to work with modules

This is phase 1, of getting java.net.URL work with modules. 

Being able to effectively specify URL protocol handler factories as fully qualified class names, through
the 'java.protocol.handler.pkgs' system property is problematic. It requires the protocol handler
factory implementation class to be public and accessible, as the current implementation tries to
instantiate it through core reflection. Since the protocol handler factory must be an implementation of
a URLStreamHandlerFactory, it lends itself to being retrofitted with a ServiceLoader lookup. Note, the
'java.protocol.handler.pkgs' system property mechanism predates ServiceLoader. URL protocol
handlers would most likely have used service loader if it were available at the time. 

Some URL protocol handlers are fundamental to the platform itself, like 'file' and 'jar', it is not
appropriate to attempt a service loader lookup for these, as they may lead to recursive initialization
issues. However, Java Plugin, Webstart, and possibly other containers, do override the 'jar' handler. A
new API will be provided for this purpose. Providing an API solution should not interfere with system
initialization as it will only be called after the system comes up and user code is executing. 

The 'file' protocol handler factory will no longer be overridable, and the system property will no longer
be consulted.

Webrev and spec diffs:
  http://cr.openjdk.java.net/~chegar/8064924/00/

I want to agree the approach and spec first, so that the spec changes can be submitted for approval. A
comprehensive test will be added before the code changes are finalised.

-Chris.

Gmane