RFR: 8289768: Clean up unused code

2022-07-05 Thread Daniel Jeliński
This patch removes many unused variables and one unused label reported by the compilers when relevant warnings are enabled. The unused code was found by compiling after removing `unused` from the list of disabled warnings for [gcc](https://github.com/openjdk/jdk/blob/master/make/autoconf/flags

Re: RFR: 8289768: Clean up unused code [v2]

2022-07-07 Thread Daniel Jeliński
) > MSVC warning. > > I only removed variables that were uninitialized or initialized without side > effects. I verified that the removed variables were not used in any > `#ifdef`'d code. I checked that the changed code still compiles on Windows, > Linux and Mac, bot

Re: RFR: 8289768: Clean up unused code [v2]

2022-07-07 Thread Daniel Jeliński
On Wed, 6 Jul 2022 05:32:29 GMT, Daniel Jeliński wrote: >> This patch removes many unused variables and one unused label reported by >> the compilers when relevant warnings are enabled. >> >> The unused code was found by compiling after removing `unused` from the list

Re: RFR: 8289768: Clean up unused code [v3]

2022-07-08 Thread Daniel Jeliński
) > MSVC warning. > > I only removed variables that were uninitialized or initialized without side > effects. I verified that the removed variables were not used in any > `#ifdef`'d code. I checked that the changed code still compiles on Windows, > Linux and Mac, bot

Re: RFR: 8289768: Clean up unused code [v3]

2022-07-08 Thread Daniel Jeliński
On Fri, 8 Jul 2022 07:08:46 GMT, Daniel Jeliński wrote: >> This patch removes many unused variables and one unused label reported by >> the compilers when relevant warnings are enabled. >> >> The unused code was found by compiling after removing `unused` from the list

Re: RFR: 8289768: Clean up unused code [v2]

2022-07-08 Thread Daniel Jeliński
On Thu, 7 Jul 2022 19:06:52 GMT, Chris Plummer wrote: >> Daniel Jeliński has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contai

Integrated: 8289768: Clean up unused code

2022-07-12 Thread Daniel Jeliński
On Tue, 5 Jul 2022 20:19:10 GMT, Daniel Jeliński wrote: > This patch removes many unused variables and one unused label reported by the > compilers when relevant warnings are enabled. > > The unused code was found by compiling after removing `unused` from the list > of disabl

RFR: 8290349: IP_DONTFRAGMENT doesn't set DF bit in IPv4 header

2022-07-20 Thread Daniel Jeliński
This patch partially fixes the issue where IPv6 sockets were fragmenting outgoing IPv4 datagrams even when IP_DONTFRAGMENT flag was set. Specifically, it fixes the issue on Linux and Windows. As far as I could tell, the issue is unfixable on Mac OS X. All systems have a separate DONTFRAGMENT fl

Re: RFR: 8276561: URL$DefaultFactory::PREFIX should be static final

2022-07-21 Thread Daniel Jeliński
On Thu, 21 Jul 2022 09:46:27 GMT, Michael McMahon wrote: > Hi, > > Could I get the following trivial code change reviewed please? Static > analysis shows one > static field declaration in java.net.URL that should be final. > > Thanks, > Michael. Marked as reviewed by djelinski (Committer).

Re: RFR: 8290349: IP_DONTFRAGMENT doesn't set DF bit in IPv4 header

2022-07-21 Thread Daniel Jeliński
On Thu, 21 Jul 2022 14:46:58 GMT, Jaikiran Pai wrote: >> This patch partially fixes the issue where IPv6 sockets were fragmenting >> outgoing IPv4 datagrams even when IP_DONTFRAGMENT flag was set. >> Specifically, it fixes the issue on Linux and Windows. As far as I could >> tell, the issue is

Re: RFR: 8290861: Remove unused field URLJarFile.BUF_SIZE

2022-07-22 Thread Daniel Jeliński
On Thu, 21 Jul 2022 20:00:37 GMT, Andrey Turbanov wrote: > Static field 'BUF_SIZE' in the class > sun.net.[www.protocol.jar.URLJarFile](http://www.protocol.jar.urljarfile/) is > unused and can be removed. Marked as reviewed by djelinski (Committer). - PR: https://git.openjdk.org/

Re: RFR: 8290349: IP_DONTFRAGMENT doesn't set DF bit in IPv4 header [v2]

2022-08-01 Thread Daniel Jeliński
EMSGSIZE. Sending large > IPv4 packets from IPv4 sockets also fails with EMSGSIZE. Sending large IPv4 > packets from IPv6 sockets succeeds. The patch does not change the observed > behavior. Daniel Jeliński has updated the pull request incrementally with one additional com

Re: RFR: 8290349: IP_DONTFRAGMENT doesn't set DF bit in IPv4 header [v2]

2022-08-01 Thread Daniel Jeliński
On Mon, 25 Jul 2022 10:51:14 GMT, Michael McMahon wrote: >> Hi Jaikiran, the point of this change was to better support systems where >> either IPv4 or IPv6 was disabled. I'm not sure if that can even happen on >> Mac. >> The change here is that if we can't create one socket, we don't immediat

Re: RFR: 8290349: IP_DONTFRAGMENT doesn't set DF bit in IPv4 header [v2]

2022-08-01 Thread Daniel Jeliński
On Mon, 1 Aug 2022 07:28:28 GMT, Alan Bateman wrote: > Have you considered changing ExtendedSocketOptions.xxxOption to take a family > parameter rather than a boolean as that would be more general and maybe > useful in the future? Passing a boolean matches what we're doing in `setIntOption0` a

Re: RFR: 8290349: IP_DONTFRAGMENT doesn't set DF bit in IPv4 header [v3]

2022-08-01 Thread Daniel Jeliński
EMSGSIZE. Sending large > IPv4 packets from IPv4 sockets also fails with EMSGSIZE. Sending large IPv4 > packets from IPv6 sockets succeeds. The patch does not change the observed > behavior. Daniel Jeliński has updated the pull request incrementally with one additional

RFR: 8285836: sun/net/www/http/KeepAliveCache/KeepAliveProperty.java failed with "RuntimeException: Failed in server"

2022-08-01 Thread Daniel Jeliński
This patch fixes a race condition in KeepAliveProperty test. The client thread could read the `pass` field and fail the test before the server thread had a chance to set the field value to `true`. The fix adds an explicit wait for the server thread to complete. Without this patch, the failure c

Re: RFR: 8290349: IP_DONTFRAGMENT doesn't set DF bit in IPv4 header [v4]

2022-08-03 Thread Daniel Jeliński
EMSGSIZE. Sending large > IPv4 packets from IPv4 sockets also fails with EMSGSIZE. Sending large IPv4 > packets from IPv6 sockets succeeds. The patch does not change the observed > behavior. Daniel Jeliński has updated the pull request incrementally with one additional c

Re: RFR: 8285836: sun/net/www/http/KeepAliveCache/KeepAliveProperty.java failed with "RuntimeException: Failed in server" [v2]

2022-08-03 Thread Daniel Jeliński
Without this patch, the failure can be easily reproduced by adding a > `Thread.sleep(100);` before `pass = !expectClose;`. Daniel Jeliński has updated the pull request incrementally with one additional commit since the last revision: Make logger static - Changes: - all: https:

Integrated: 8285836: sun/net/www/http/KeepAliveCache/KeepAliveProperty.java failed with "RuntimeException: Failed in server"

2022-08-03 Thread Daniel Jeliński
On Mon, 1 Aug 2022 11:01:01 GMT, Daniel Jeliński wrote: > This patch fixes a race condition in KeepAliveProperty test. The client > thread could read the `pass` field and fail the test before the server thread > had a chance to set the field value to `true`. The fix adds an expl

Integrated: 8290349: IP_DONTFRAGMENT doesn't set DF bit in IPv4 header

2022-08-04 Thread Daniel Jeliński
On Wed, 20 Jul 2022 17:19:50 GMT, Daniel Jeliński wrote: > This patch partially fixes the issue where IPv6 sockets were fragmenting > outgoing IPv4 datagrams even when IP_DONTFRAGMENT flag was set. Specifically, > it fixes the issue on Linux and Windows. As far as I could tell, the

Re: RFR: 8293842: IPv6-only systems throws UnsupportedOperationException for several socket/TCP options

2022-09-15 Thread Daniel Jeliński
On Thu, 15 Sep 2022 07:25:04 GMT, Man Cao wrote: > Hi all, > > Could anyone review this bug fix for ipv6-only system? See > https://bugs.openjdk.org/browse/JDK-8293842 for detailed description of this > bug. > > Ideally, the `socket(PF_INET6, ...)` or `socket(PF_INET, ...)` call should > dep

Re: RFR: 8293064: Remove unused NET_xxx functions

2022-09-19 Thread Daniel Jeliński
On Mon, 19 Sep 2022 14:32:24 GMT, Darragh Clarke wrote: > No tests were affected so this is purely a removal PR apart from updating > copyright headers. > I ran tests for Tier 1,2&3 and everything seems to be passing Changes requested by djelinski (Committer). src/java.base/share/native/libnet

RFR: 8294115: JNI local refs exceeds capacity warning in NetworkInterface::getAll

2022-09-21 Thread Daniel Jeliński
Please review this patch that fixes the warning `JNI local refs ... exceeds capacity` on Windows machines running with IPv6 stack enabled. This case was missed in JDK-8187450 / #2963. I verified that with this patch applied, the warning does not appear on a machine with 60+ interfaces. Tier2 al

Re: RFR: 8293064: Remove unused NET_xxx functions [v2]

2022-09-21 Thread Daniel Jeliński
On Wed, 21 Sep 2022 14:01:00 GMT, Darragh Clarke wrote: >> No tests were affected so this is purely a removal PR apart from updating >> copyright headers. >> I ran tests for Tier 1,2&3 and everything seems to be passing > > Darragh Clarke has updated the pull request incrementally with one addit

RFR: 8293562: blocked threads with KeepAliveCache.get

2022-09-23 Thread Daniel Jeliński
Please review this patch that makes sure KeepAliveCache does not block all threads while closing sockets. Changes: - get operation no longer closes sockets; if there's no socket that is recent enough, get returns null and lets the cleaner thread close the sockets - put operation closes sockets w

Re: RFR: 8293562: blocked threads with KeepAliveCache.get [v2]

2022-09-27 Thread Daniel Jeliński
easing the cache lock > - additionally, we set the socket timeout to 1 millisecond before calling > socket.close > > The new test fails with `Wait for second request timed out` without this > patch, passes after the changes. Tiers 1-3 clean. Daniel Jeliński has updated the pull re

Re: RFR: 8293562: blocked threads with KeepAliveCache.get [v2]

2022-09-27 Thread Daniel Jeliński
On Fri, 23 Sep 2022 10:58:19 GMT, Daniel Fuchs wrote: > we should set the SO_TIMEOUT only for SSLSockets (in the HttpsClient subclass) Done. > and make sure we do it everywhere where serverSocket.close() is called. The only other place is `checkURLSpoofing`; I'd rather not touch that method he

Re: RFR: 8293562: blocked threads with KeepAliveCache.get [v2]

2022-09-27 Thread Daniel Jeliński
On Tue, 27 Sep 2022 13:11:09 GMT, Daniel Fuchs wrote: >> Daniel Jeliński has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Only set timeout on SSLSockets > > test/jdk/sun/net/www/http/KeepAliveCache/B8293562.

Re: RFR: 8293562: blocked threads with KeepAliveCache.get [v3]

2022-09-27 Thread Daniel Jeliński
easing the cache lock > - additionally, we set the socket timeout to 1 millisecond before calling > socket.close > > The new test fails with `Wait for second request timed out` without this > patch, passes after the changes. Tiers 1-3 clean. Daniel Jeliński has updated the pull re

Re: RFR: 8293562: blocked threads with KeepAliveCache.get [v3]

2022-09-28 Thread Daniel Jeliński
On Wed, 28 Sep 2022 14:01:18 GMT, Jaikiran Pai wrote: >> Daniel Jeliński has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Stop using getLocalhost > > src/java.base/share/classes/sun/net/www/http/KeepAlive

Re: RFR: 8293562: blocked threads with KeepAliveCache.get [v4]

2022-09-28 Thread Daniel Jeliński
easing the cache lock > - additionally, we set the socket timeout to 1 millisecond before calling > socket.close > > The new test fails with `Wait for second request timed out` without this > patch, passes after the changes. Tiers 1-3 clean. Daniel Jeliński has updated the pull req

Re: RFR: 8293562: blocked threads with KeepAliveCache.get [v4]

2022-09-28 Thread Daniel Jeliński
On Wed, 28 Sep 2022 16:15:42 GMT, Michael McMahon wrote: >> Daniel Jeliński has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Close connections in finally block >> - Fix copyright year > > src/java

Re: RFR: 8293562: blocked threads with KeepAliveCache.get [v5]

2022-09-28 Thread Daniel Jeliński
easing the cache lock > - additionally, we set the socket timeout to 1 millisecond before calling > socket.close > > The new test fails with `Wait for second request timed out` without this > patch, passes after the changes. Tiers 1-3 clean. Daniel Jeliński has updated the pull re

Re: RFR: 8294115: JNI local refs exceeds capacity warning in NetworkInterface::getAll [v2]

2022-09-29 Thread Daniel Jeliński
> machine with 60+ interfaces. Tier2 also passes. Daniel Jeliński has updated the pull request incrementally with one additional commit since the last revision: Update copyright year - Changes: - all: https://git.openjdk.org/jdk/pull/10377/files - new: https://git.openjdk.org

Re: RFR: 8293562: blocked threads with KeepAliveCache.get [v5]

2022-09-29 Thread Daniel Jeliński
On Thu, 29 Sep 2022 09:09:59 GMT, Michael McMahon wrote: >> Daniel Jeliński has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Describe oldClient > > src/java.base/share/classes/sun/net/www/protocol/http

Integrated: 8294115: JNI local refs exceeds capacity warning in NetworkInterface::getAll

2022-09-29 Thread Daniel Jeliński
On Wed, 21 Sep 2022 15:37:24 GMT, Daniel Jeliński wrote: > Please review this patch that fixes the warning `JNI local refs ... exceeds > capacity` on Windows machines running with IPv6 stack enabled. > > This case was missed in JDK-8187450 / #2963. > > I verified that with

Re: RFR: 8293562: blocked threads with KeepAliveCache.get [v5]

2022-09-30 Thread Daniel Jeliński
On Fri, 30 Sep 2022 10:40:28 GMT, Michael McMahon wrote: >> Daniel Jeliński has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Describe oldClient > > src/java.base/share/classes/sun/net/www/http/KeepAlive

Re: RFR: 8293562: blocked threads with KeepAliveCache.get [v6]

2022-09-30 Thread Daniel Jeliński
easing the cache lock > - additionally, we set the socket timeout to 1 millisecond before calling > socket.close > > The new test fails with `Wait for second request timed out` without this > patch, passes after the changes. Tiers 1-3 clean. Daniel Jeliński has updated the pull re

Integrated: 8293562: blocked threads with KeepAliveCache.get

2022-10-02 Thread Daniel Jeliński
On Fri, 23 Sep 2022 06:55:11 GMT, Daniel Jeliński wrote: > Please review this patch that makes sure KeepAliveCache does not block all > threads while closing sockets. > > Changes: > - get operation no longer closes sockets; if there's no socket that is recent > enoug

Re: RFR: 8293562: blocked threads with KeepAliveCache.get [v6]

2022-10-02 Thread Daniel Jeliński
On Fri, 30 Sep 2022 12:38:26 GMT, Daniel Jeliński wrote: >> Please review this patch that makes sure KeepAliveCache does not block all >> threads while closing sockets. >> >> Changes: >> - get operation no longer closes sockets; if there's no socket that is

RFR: 8186765: Speed up test sun/net/www/protocol/https/HttpsClient/ProxyAuthTest.java

2022-10-03 Thread Daniel Jeliński
This PR reduces the execution time of ProxyAuthTest. Before this change the test always required at least 3 minutes to complete (6x 30 seconds timeout in `SSLSocketTemplate`'s `sslServerSocket.accept()`). After this change the test does not open a server socket when it is not necessary. The tes

Re: RFR: 8186765: Speed up test sun/net/www/protocol/https/HttpsClient/ProxyAuthTest.java [v2]

2022-10-04 Thread Daniel Jeliński
ocket when it is not > necessary. > > The test continues to pass. Daniel Jeliński has updated the pull request incrementally with one additional commit since the last revision: Update copyright - Changes: - all: https://git.openjdk.org/jdk/pull/10539/files - new: https://g

Re: RFR: 8186765: Speed up test sun/net/www/protocol/https/HttpsClient/ProxyAuthTest.java [v2]

2022-10-04 Thread Daniel Jeliński
On Tue, 4 Oct 2022 07:04:42 GMT, Daniel Jeliński wrote: >> This PR reduces the execution time of ProxyAuthTest. >> >> Before this change the test always required at least 3 minutes to complete >> (6x 30 seconds timeout in `SSLSocketTemplate`'s `sslServerSocket.acc

Integrated: 8186765: Speed up test sun/net/www/protocol/https/HttpsClient/ProxyAuthTest.java

2022-10-04 Thread Daniel Jeliński
On Mon, 3 Oct 2022 14:35:46 GMT, Daniel Jeliński wrote: > This PR reduces the execution time of ProxyAuthTest. > > Before this change the test always required at least 3 minutes to complete > (6x 30 seconds timeout in `SSLSocketTemplate`'s `sslServerSocket.accept()`). > A

RFR: 8294958: java/net/httpclient/ConnectTimeout tests are slow

2022-10-07 Thread Daniel Jeliński
Please review this test-only change that improves the execution times of ConnectTimeout tests: - ConnectTimeoutHandshakeAsync and ConnectTimeoutHandshakeSync: before this change each one takes 80+ seconds to execute. - ConnectTimeoutNoProxyAsync, ConnectTimeoutNoProxySync, ConnectTimeoutWithProx

Integrated: 8294958: java/net/httpclient/ConnectTimeout tests are slow

2022-10-11 Thread Daniel Jeliński
On Fri, 7 Oct 2022 11:53:25 GMT, Daniel Jeliński wrote: > Please review this test-only change that improves the execution times of > ConnectTimeout tests: > - ConnectTimeoutHandshakeAsync and ConnectTimeoutHandshakeSync: before this > change each one takes 80+ second

RFR: 8266900: java/net/httpclient/ShortResponseBody.java fails on windows with java.io.IOException: Unable to establish loopback connection

2022-10-20 Thread Daniel Jeliński
This PR reduces the number of requests performed by ShortResponseBody* tests from 570 to 100. It also reduces the number of httpclients created from one per request/URL to one per 10 requests. This in turn will translate to reduced frequency of failures caused by all ephemeral ports being in use

Re: RFR: 8266900: java/net/httpclient/ShortResponseBody.java fails on windows with java.io.IOException: Unable to establish loopback connection [v2]

2022-10-20 Thread Daniel Jeliński
and > once with async call. > > The tests continue to pass. Daniel Jeliński has updated the pull request incrementally with one additional commit since the last revision: Really change client every 10 requests - Changes: - all: https://git.openjdk.org/jdk/pull/10794/fi

Re: RFR: 8266900: java/net/httpclient/ShortResponseBody.java fails on windows with java.io.IOException: Unable to establish loopback connection [v2]

2022-10-20 Thread Daniel Jeliński
On Thu, 20 Oct 2022 13:49:42 GMT, Daniel Fuchs wrote: >> Daniel Jeliński has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Really change client every 10 requests > > test/jdk/java/net/httpclient/ShortRespons

RFR: 8295777: java/net/httpclient/ConnectExceptionTest.java should not rely on system resolver

2022-10-21 Thread Daniel Jeliński
This PR makes ConnectExceptionTest use a non-existent hosts file for name resolution. The test verifies that the HttpClient throws a ConnectException in response to DNS resolution failures. Slow name resolution makes this test take more time to complete. With this patch applied, the test become

RFR: 8295792: Clean up old async close code

2022-10-21 Thread Daniel Jeliński
Please review this PR that removes the remains of old fdTable-based socket close synchronization. Verified that tier1-3 tests continue to pass on Linux, MacOS and Windows. Did not verify AIX. Also removed one slow test for an issue in fdtable implementation; as far as I could tell, it is no lo

Re: RFR: 8295792: Clean up old async close code

2022-10-21 Thread Daniel Jeliński
On Fri, 21 Oct 2022 16:04:24 GMT, Alan Bateman wrote: >> Please review this PR that removes the remains of old fdTable-based socket >> close synchronization. >> >> Verified that tier1-3 tests continue to pass on Linux, MacOS and Windows. >> Did not verify AIX. >> >> Also removed one slow test

Re: RFR: 8295777: java/net/httpclient/ConnectExceptionTest.java should not rely on system resolver

2022-10-23 Thread Daniel Jeliński
On Fri, 21 Oct 2022 10:30:21 GMT, Daniel Fuchs wrote: > the expectation is that this test will never need to successfully resolve any > address - right? That's correct. Thanks for the reviews! - PR: https://git.openjdk.org/jdk/pull/10811

Integrated: 8266900: java/net/httpclient/ShortResponseBody.java fails on windows with java.io.IOException: Unable to establish loopback connection

2022-10-23 Thread Daniel Jeliński
On Thu, 20 Oct 2022 12:58:13 GMT, Daniel Jeliński wrote: > This PR reduces the number of requests performed by ShortResponseBody* tests > from 570 to 100. It also reduces the number of httpclients created from one > per request/URL to one per 10 requests. This in turn will tra

Integrated: 8295777: java/net/httpclient/ConnectExceptionTest.java should not rely on system resolver

2022-10-23 Thread Daniel Jeliński
On Fri, 21 Oct 2022 09:54:13 GMT, Daniel Jeliński wrote: > This PR makes ConnectExceptionTest use a non-existent hosts file for name > resolution. > > The test verifies that the HttpClient throws a ConnectException in response > to DNS resolution failures. Slow name resolution

Integrated: 8295792: Clean up old async close code

2022-10-24 Thread Daniel Jeliński
On Fri, 21 Oct 2022 14:28:02 GMT, Daniel Jeliński wrote: > Please review this PR that removes the remains of old fdTable-based socket > close synchronization. > > Verified that tier1-3 tests continue to pass on Linux, MacOS and Windows. Did > not verify AIX. > > Also

Re: RFR: 8297132: BACKOUT JDK-8296889: Race condition when cancelling a request

2022-11-16 Thread Daniel Jeliński
On Wed, 16 Nov 2022 12:16:47 GMT, Daniel Fuchs wrote: > This fix for [JDK-8296889](https://bugs.openjdk.org/browse/JDK-8296889) is > causing trouble with the CancelStreamedBodyTest. Let's back it out until a > better solution is found. Marked as reviewed by djelinski (Committer).

Re: RFR: 8297200: java/net/httpclient/SpecialHeadersTest.java failed once in AssertionError due to selector thread remaining alive [v2]

2022-11-22 Thread Daniel Jeliński
On Tue, 22 Nov 2022 21:34:38 GMT, Daniel Fuchs wrote: >> The java/net/httpclient/SpecialHeadersTest.java test has been observed >> failing once, due to a selector thread still running after all operations >> had terminated. This change slightly alter the test logic to check the >> shared clien

Re: RFR: 8223783: sun/net/www/http/HttpClient/MultiThreadTest.java sometimes detect threads+1 connections [v4]

2022-11-23 Thread Daniel Jeliński
On Tue, 22 Nov 2022 17:30:56 GMT, Daniel Fuchs wrote: >> Please find here a test fix for the >> sun/net/www/http/HttpClient/MultiThreadTest. >> >> This test makes concurrent connections to a server using multiple threads, >> and due to keep-alive, expects that there should not be more connecti

Re: RFR: 8223783: sun/net/www/http/HttpClient/MultiThreadTest.java sometimes detect threads+1 connections [v6]

2022-11-24 Thread Daniel Jeliński
On Wed, 23 Nov 2022 14:25:37 GMT, Daniel Fuchs wrote: >> Please find here a test fix for the >> sun/net/www/http/HttpClient/MultiThreadTest. >> >> This test makes concurrent connections to a server using multiple threads, >> and due to keep-alive, expects that there should not be more connecti

RFR: 8297976: Remove sun.net.ProgressMonitor and related classes

2022-12-02 Thread Daniel Jeliński
Please review this patch that removes progress monitoring classes used by UrlConnection. Since Java 9 these classes are not used in the JDK, and are not exported from java.base. If anyone was still using them, reimplementing them in user code should be pretty straightforward. This PR also fixes

Re: RFR: 8297976: Remove sun.net.ProgressMonitor and related classes [v2]

2022-12-05 Thread Daniel Jeliński
ue again. I can add a test for that if you think it still > makes sense. > > I had to adjust `ProxyModuleMapping.java` test which used > `sun.net.ProgressListener` as an example of a module-private interface; I > replaced it with another public interface from the same package. &

Re: RFR: 8297976: Remove sun.net.ProgressMonitor and related classes [v2]

2022-12-05 Thread Daniel Jeliński
On Mon, 5 Dec 2022 14:06:10 GMT, Daniel Jeliński wrote: >> Please review this patch that removes progress monitoring classes used by >> UrlConnection. >> Since Java 9 these classes are not used in the JDK, and are not exported >> from java.base. If anyone was still us

Re: RFR: 8297976: Remove sun.net.ProgressMonitor and related classes [v3]

2022-12-05 Thread Daniel Jeliński
ue again. I can add a test for that if you think it still > makes sense. > > I had to adjust `ProxyModuleMapping.java` test which used > `sun.net.ProgressListener` as an example of a module-private interface; I > replaced it with another public interface from the same package. &

Re: RFR: 8297976: Remove sun.net.ProgressMonitor and related classes [v4]

2022-12-06 Thread Daniel Jeliński
ue again. I can add a test for that if you think it still > makes sense. > > I had to adjust `ProxyModuleMapping.java` test which used > `sun.net.ProgressListener` as an example of a module-private interface; I > replaced it with another public interface from the same package. &

Re: RFR: 8297976: Remove sun.net.ProgressMonitor and related classes [v2]

2022-12-06 Thread Daniel Jeliński
On Tue, 6 Dec 2022 12:43:44 GMT, Daniel Fuchs wrote: >> test/jdk/sun/net/www/http/KeepAliveStream/KeepAliveStreamFinalizer.java line >> 175: >> >>> 173: public InputStream getInputStream() throws IOException { >>> 174: if (finalized) { >>> 175: System.out.pri

Re: RFR: 8297976: Remove sun.net.ProgressMonitor and related classes [v4]

2022-12-07 Thread Daniel Jeliński
On Tue, 6 Dec 2022 13:42:04 GMT, Daniel Jeliński wrote: >> Please review this patch that removes progress monitoring classes used by >> UrlConnection. >> Since Java 9 these classes are not used in the JDK, and are not exported >> from java.base. If anyone was still us

Integrated: 8297976: Remove sun.net.ProgressMonitor and related classes

2022-12-07 Thread Daniel Jeliński
On Fri, 2 Dec 2022 08:31:25 GMT, Daniel Jeliński wrote: > Please review this patch that removes progress monitoring classes used by > UrlConnection. > Since Java 9 these classes are not used in the JDK, and are not exported from > java.base. If anyone was still using them, reimple

RFR: 6914801: IPv6 unavailable if stdin is a socket

2022-12-12 Thread Daniel Jeliński
This patch reenables IPv6 stack when stdin is an IPv4 socket. The code that blocked IPv6 was introduced in JDK-4673940 back when JDK could only operate with either IPv4 or IPv6 sockets, and was using `IPv6_available` to determine which socket type was in use. Now that JDK is able to operate with

RFR: 8298498: sun/net/www/http/KeepAliveCache/B8291637.java fails with "Server exception terminating: java.net.SocketException: Socket closed"

2022-12-13 Thread Daniel Jeliński
This patch attempts to address a rare test failure where read from a socket succeeds immediately after sending the response. The existing `readRequest` method did not verify if it received the entire request. The method `readOneRequest` (copied from other tests) makes sure that we read the trai

Re: RFR: 8298498: sun/net/www/http/KeepAliveCache/B8291637.java fails with "Server exception terminating: java.net.SocketException: Socket closed"

2022-12-14 Thread Daniel Jeliński
On Tue, 13 Dec 2022 10:34:16 GMT, Daniel Jeliński wrote: > This patch attempts to address a rare test failure where read from a socket > succeeds immediately after sending the response. > > The existing `readRequest` method did not verify if it received the entire > requ

Integrated: 8298498: sun/net/www/http/KeepAliveCache/B8291637.java fails with "Server exception terminating: java.net.SocketException: Socket closed"

2022-12-14 Thread Daniel Jeliński
On Tue, 13 Dec 2022 10:34:16 GMT, Daniel Jeliński wrote: > This patch attempts to address a rare test failure where read from a socket > succeeds immediately after sending the response. > > The existing `readRequest` method did not verify if it received the entire > requ

Re: RFR: 8299018: java/net/httpclient/HttpsTunnelAuthTest.java fails with java.io.IOException: HTTP/1.1 header parser received no bytes [v2]

2022-12-19 Thread Daniel Jeliński
On Mon, 19 Dec 2022 10:36:59 GMT, Daniel Fuchs wrote: >> Please find here a trivial fix for a test issue in the HttpClient test's >> ProxyServer. >> >> The ProxyServer has a bad printf that throws an >> IllegalFormatConversionException, which causes the proxy to close the >> connection after

Re: RFR: 8299018: java/net/httpclient/HttpsTunnelAuthTest.java fails with java.io.IOException: HTTP/1.1 header parser received no bytes [v2]

2022-12-19 Thread Daniel Jeliński
On Mon, 19 Dec 2022 10:41:05 GMT, Daniel Fuchs wrote: >> Please find here a trivial fix for a test issue in the HttpClient test's >> ProxyServer. >> >> The ProxyServer has a bad printf that throws an >> IllegalFormatConversionException, which causes the proxy to close the >> connection after

Re: RFR: 8299018: java/net/httpclient/HttpsTunnelAuthTest.java fails with java.io.IOException: HTTP/1.1 header parser received no bytes [v3]

2022-12-19 Thread Daniel Jeliński
On Mon, 19 Dec 2022 13:11:16 GMT, Daniel Fuchs wrote: >> Please find here a trivial fix for a test issue in the HttpClient test's >> ProxyServer. >> >> The ProxyServer has a bad printf that throws an >> IllegalFormatConversionException, which causes the proxy to close the >> connection after

Re: RFR: 8299015: Ensure that HttpResponse.BodySubscribers.ofFile writes all bytes [v3]

2022-12-20 Thread Daniel Jeliński
On Tue, 20 Dec 2022 10:34:44 GMT, Daniel Fuchs wrote: >> I replaced usages with Math::addExact, and generalised the catch to handle >> arithmetic exceptions too > > That's the reason I originally didn't comment on the size limitation to > Integer.MAX_VALUE - this is an acceptable limitation and

Re: RFR: 8299015: Ensure that HttpResponse.BodySubscribers.ofFile writes all bytes [v6]

2022-12-20 Thread Daniel Jeliński
On Tue, 20 Dec 2022 14:53:11 GMT, Chris Hegarty wrote: >> The implementation of `BodySubscribers.ofFile` does not correctly handle the >> case of a short gathering write. The write should be retried until all the >> bytes have been written to the underlying file. >> >> This is generally not an

Re: RFR: 8299015: Ensure that HttpResponse.BodySubscribers.ofFile writes all bytes [v7]

2022-12-21 Thread Daniel Jeliński
On Wed, 21 Dec 2022 08:38:37 GMT, Chris Hegarty wrote: >> The implementation of `BodySubscribers.ofFile` does not correctly handle the >> case of a short gathering write. The write should be retried until all the >> bytes have been written to the underlying file. >> >> This is generally not an

Re: RFR: 6914801: IPv6 unavailable if stdin is a socket

2023-01-02 Thread Daniel Jeliński
On Mon, 12 Dec 2022 20:30:05 GMT, Daniel Jeliński wrote: > This patch reenables IPv6 stack when stdin is an IPv4 socket. > > The code that blocked IPv6 was introduced in JDK-4673940 back when JDK could > only operate with either IPv4 or IPv6 sockets, and was using `IPv6_avai

Re: RFR: 8299437: Make InetSocketAddressHolder shallowly immutable

2023-01-02 Thread Daniel Jeliński
On Mon, 2 Jan 2023 09:00:43 GMT, Per Minborg wrote: > This PR proposes to make the class > `java.net.InetSocketAddress.InetSocketAddressHolder` shallowly immutable Marked as reviewed by djelinski (Committer). - PR: https://git.openjdk.org/jdk/pull/11809

Re: RFR: 6914801: IPv6 unavailable if stdin is a socket [v2]

2023-01-04 Thread Daniel Jeliński
JDK is able to operate > with both IPv4 and IPv6 sockets at the same time, the check for IPv4 stdin is > no longer relevant. > > Included test passes with the changes applied, fails without them. Other > tier1-3 tests also pass. Daniel Jeliński has updated the pull request inc

Re: RFR: 6914801: IPv6 unavailable if stdin is a socket [v2]

2023-01-04 Thread Daniel Jeliński
On Tue, 3 Jan 2023 18:26:36 GMT, Michael McMahon wrote: >> Daniel Jeliński has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Additional logging > > test/jdk/java/nio/channels/spi/SelectorProvider/inheritedCha

Integrated: 6914801: IPv6 unavailable if stdin is a socket

2023-01-08 Thread Daniel Jeliński
On Mon, 12 Dec 2022 20:30:05 GMT, Daniel Jeliński wrote: > This patch reenables IPv6 stack when stdin is an IPv4 socket. > > The code that blocked IPv6 was introduced in JDK-4673940 back when JDK could > only operate with either IPv4 or IPv6 sockets, and was using `IPv6_avai

Re: Performance of NetworkInterface methods on Windows

2023-02-08 Thread Daniel Jeliński
Hi Richard, welcome to net-dev! I'm sure you noticed already that the createNetworkInterface is only called when you set the system property java.net.preferIPv4Stack to true, or when you are on Windows 95/2000. In all other cases your code will use createNetworkInterfaceXP, which was fixed in JDK-

Re: Performance of NetworkInterface methods on Windows

2023-02-16 Thread Daniel Jeliński
Hi Rich, Thanks for working on this. Please create a PR and put "8302659" (without the quotes) in the PR title; this will link the PR to the JBS issue. You may also need to remove the executable bit from NetworkInterface.c to make the bots happy. We'll continue the review on the PR. I need more ti

Re: RFR: 8302659: Modernize Windows native code for NetworkInterface [v2]

2023-02-16 Thread Daniel Jeliński
On Thu, 16 Feb 2023 16:49:09 GMT, Rich DiCroce wrote: >> Improves performance and correctness, as discussed on the net-dev mailing >> list. > > Rich DiCroce has updated the pull request incrementally with one additional > commit since the last revision: > > Limit line length to 80-ish charac

Re: RFR: 8302659: Modernize Windows native code for NetworkInterface [v2]

2023-02-16 Thread Daniel Jeliński
On Thu, 16 Feb 2023 18:05:05 GMT, Rich DiCroce wrote: >> src/java.base/windows/native/libnet/NetworkInterface.c line 523: >> >>> 521: * Signature: (Ljava/lang/String;I)Z >>> 522: */ >>> 523: JNIEXPORT jboolean JNICALL >>> Java_java_net_NetworkInterface_supportsMulticast0(JNIEnv *env, jclass c

Re: RFR: 8302659: Modernize Windows native code for NetworkInterface [v2]

2023-02-16 Thread Daniel Jeliński
On Thu, 16 Feb 2023 18:59:06 GMT, Rich DiCroce wrote: >> Ha! Apparently I have a machine where the implementation of >> `supportsMulticast` implementation makes a difference. On my machine the >> test `jdk/java/net/SocketOption/OptionsTest.java` is failing with: >> >> java.net.SocketException:

Re: RFR: 8302664: Fix several incorrect usages of Preconditions.checkFromIndexSize

2023-02-17 Thread Daniel Jeliński
On Thu, 16 Feb 2023 14:42:52 GMT, Jaikiran Pai wrote: > Can I please get a review of this change which fixes the usage of > `Preconditions.checkFromIndexSize`? This addresses > https://bugs.openjdk.org/browse/JDK-8302664. > > There was an oversight when these changes were introduced in > http

Re: RFR: 8302659: Modernize Windows native code for NetworkInterface [v2]

2023-02-17 Thread Daniel Jeliński
On Thu, 16 Feb 2023 21:48:19 GMT, Daniel Fuchs wrote: >> Note that the new code doesn't attempt to sort anything. If it happens to be >> sorted by LUID, that's the underlying API at work. The MS docs don't say >> anything about ordering, so this is probably an implementation detail and I >> wo

Re: RFR: 8302659: Modernize Windows native code for NetworkInterface [v2]

2023-02-17 Thread Daniel Jeliński
On Thu, 16 Feb 2023 17:56:58 GMT, Rich DiCroce wrote: >> src/java.base/windows/native/libnet/NetworkInterface.c line 72: >> >>> 70: return FALSE; >>> 71: } >>> 72: if (GetAnycastIpAddressTable(addrFamily, anyAddrs) != NO_ERROR) { >> >> Were the anycast addresses covered by the e

RFR: 8302732: sun/net/www/http/HttpClient/MultiThreadTest.java still failing intermittently

2023-02-21 Thread Daniel Jeliński
Please review this fix for a race in KeepAliveCache. The sweeper thread (`KeepAliveCache.run()`) terminates when the cache is empty. The check for empty cache was performed without holding the cache lock. As a result, there was a small window of time where a new connection could be added to th

Re: RFR: 8301701 : java/net/DatagramSocket/DatagramSocketMulticasting.java should be hardened [v4]

2023-02-21 Thread Daniel Jeliński
On Tue, 21 Feb 2023 12:51:54 GMT, Darragh Clarke wrote: >> Updated `DatagramSocketMulticasting` to use Junit and also hardened the test >> to avoid occasional interference from other tests. >> >> - Test now uses Junit Assertions, in general if the assertion used had been >> `assertTrue(foo==ba

Re: RFR: 8301701 : java/net/DatagramSocket/DatagramSocketMulticasting.java should be hardened [v4]

2023-02-21 Thread Daniel Jeliński
On Tue, 21 Feb 2023 15:11:39 GMT, Darragh Clarke wrote: >> It may be that it's the other calls to `assertEquals` that are wrong... > > looking at the docs for Junit5 > https://junit.org/junit5/docs/5.0.1/api/org/junit/jupiter/api/Assertions.html > > > public static void assertEquals(Object exp

Re: RFR: 8293786: HttpClient will not send more than 64 kb of data from the 2nd request in http2

2023-02-22 Thread Daniel Jeliński
On Tue, 21 Feb 2023 17:31:29 GMT, Conor Cleary wrote: > ### Description > Submitter reported when sending data of a length greater than 64kb using the > `HttpClient` with HTTP/2, the HttpClient would hang indefinitely. Through > reproducing the issue and analysing logs it was also seen that the

Re: RFR: 8293786: HttpClient will not send more than 64 kb of data from the 2nd request in http2

2023-02-22 Thread Daniel Jeliński
On Wed, 22 Feb 2023 12:37:11 GMT, Daniel Fuchs wrote: >> src/java.net.http/share/classes/jdk/internal/net/http/Stream.java line 556: >> >>> 554: Flow.Subscriber subscriber = >>> 555: responseSubscriber == null ? >>> pendingResponseSubscriber : responseSubscriber;

Re: RFR: 8293786: HttpClient will not send more than 64 kb of data from the 2nd request in http2

2023-02-22 Thread Daniel Jeliński
On Tue, 21 Feb 2023 17:31:29 GMT, Conor Cleary wrote: > ### Description > Submitter reported when sending data of a length greater than 64kb using the > `HttpClient` with HTTP/2, the HttpClient would hang indefinitely. Through > reproducing the issue and analysing logs it was also seen that the

Re: RFR: 8302732: sun/net/www/http/HttpClient/MultiThreadTest.java still failing intermittently [v2]

2023-02-23 Thread Daniel Jeliński
ard to reproduce without > adding delays in production code.. Daniel Jeliński has updated the pull request incrementally with one additional commit since the last revision: Remove unnecessary lock - Changes: - all: https://git.openjdk.org/jdk/pull/12676/files - new: https://g

Re: RFR: 8302732: sun/net/www/http/HttpClient/MultiThreadTest.java still failing intermittently

2023-02-23 Thread Daniel Jeliński
On Mon, 20 Feb 2023 19:38:35 GMT, Daniel Jeliński wrote: > Please review this fix for a race in KeepAliveCache. > > The sweeper thread (`KeepAliveCache.run()`) terminates when the cache is > empty. The check for empty cache was performed without holding the cache > lock. As

Re: RFR: 8302659: Modernize Windows native code for NetworkInterface [v3]

2023-02-23 Thread Daniel Jeliński
On Wed, 22 Feb 2023 17:40:31 GMT, Rich DiCroce wrote: >> Improves performance and correctness, as discussed on the net-dev mailing >> list. > > Rich DiCroce has updated the pull request incrementally with two additional > commits since the last revision: > > - Forgot to add file > - Resolve

  1   2   3   4   5   >