Re: RFR: 8303485: Replacing os.name for operating system customization [v6]

2023-03-24 Thread Michael Osipov
On Fri, 24 Mar 2023 17:01:37 GMT, Roger Riggs wrote: >> That is acceptable, totally. > > Not the rabbit-hole I expected to go down today or for an informal comment on > an internal API. > I have no skin in that game. > https://www.redhat.com/en/topics/linux/what-is-linux Joke, they should know

Re: RFR: 8303485: Replacing os.name for operating system customization [v7]

2023-03-24 Thread Roger Riggs
> Improvements to support OS specific customization for JDK internal use: > - To select values and code; allowing elimination of unused code and values > - Optionally evaluated by build processes, compilation, or archiving (i.e. > CDS) > - Simple API to replace adhoc comparisons with `os.name`

Re: RFR: 8303485: Replacing os.name for operating system customization [v6]

2023-03-24 Thread Roger Riggs
On Fri, 24 Mar 2023 16:53:05 GMT, Michael Osipov wrote: >> If you are referring to "Red Hat Enterprise Linux", it'd be correct (AFAIK) >> to say that Red Hat identifies "Red Hat Enterprise Linux" as an operating >> system, but I wouldn't go so far as to say that Red Hat calls "Linux" an >> ope

Re: RFR: 8303485: Replacing os.name for operating system customization [v6]

2023-03-24 Thread Michael Osipov
On Fri, 24 Mar 2023 16:51:46 GMT, David M. Lloyd wrote: >> Well, no. It is just a kernel. Without a userland not an OS. That is why >> they call it GNU/Linux. Kernel + userland. > > If you are referring to "Red Hat Enterprise Linux", it'd be correct (AFAIK) > to say that Red Hat identifies "Red

Re: RFR: 8303485: Replacing os.name for operating system customization [v6]

2023-03-24 Thread David M . Lloyd
On Fri, 24 Mar 2023 16:41:02 GMT, Michael Osipov wrote: >> A bit of a quibble, several internet sources identify Linux as an operating >> system (including Redhat). > > Well, no. It is just a kernel. Without a userland not an OS. That is why they > call it GNU/Linux. Kernel + userland. If you

Re: RFR: 8304818: Prune HttpURLConnection cache when corresponding Authenticator is garbage collected [v2]

2023-03-24 Thread Michael McMahon
On Fri, 24 Mar 2023 16:22:17 GMT, Daniel Jeliński wrote: >> jshell> var map = Map.of(1,1,2,2,3,3,4,4) >> map ==> {1=1, 2=2, 3=3, 4=4} >> >> jshell> var map2 = new HashMap(); >> map2 ==> {} >> >> jshell> map2.putAll(map) >> >> jshell> map2.forEach((k, v) -> map2.remove(k)); >> | Exception java

Re: RFR: 8304818: Prune HttpURLConnection cache when corresponding Authenticator is garbage collected [v2]

2023-03-24 Thread Michael McMahon
On Thu, 23 Mar 2023 17:10:02 GMT, Michael McMahon wrote: >> test/jdk/sun/net/www/protocol/http/AuthCache.java line 136: >> >>> 134: System.gc(); >>> 135: delay(1); >>> 136: System.gc(); >> >> I suggest creating a weak reference (clauth1) with a reference queue, and >> t

Re: RFR: 8303485: Replacing os.name for operating system customization [v6]

2023-03-24 Thread Michael Osipov
On Fri, 24 Mar 2023 16:08:30 GMT, Roger Riggs wrote: >> src/java.base/share/classes/jdk/internal/util/OperatingSystem.java line 66: >> >>> 64: >>> 65: /** >>> 66: * The Linux Operating system. >> >> For the sake if completeness, Linux isn't an operating system, so this >> statement i

Re: Proposal to add another option to configure the DNS cache

2023-03-24 Thread Sergey Bylokhov
On 3/14/23 01:23, Daniel Jeliński wrote: Thanks Sergey for the additional info. Your idea sounds reasonable to me. RFC 8767 describes a similar concept that is implemented by a few resolvers already. I have filed the ticket to track this enhancement: https://bugs.openjdk.org/browse/JDK-8304885

Re: RFR: 8304818: Prune HttpURLConnection cache when corresponding Authenticator is garbage collected [v2]

2023-03-24 Thread Michael McMahon
> Hi, > > Can I get a review for this please? This change uses a Cleaner to check when > java.net.Authenticator instances become unreachable, and then prunes the > authentication cache for entries that correspond to that Authenticator and > therefore cannot be used again. This stops the authent

Re: RFR: 8303485: Replacing os.name for operating system customization [v6]

2023-03-24 Thread Roger Riggs
On Fri, 24 Mar 2023 16:04:38 GMT, Roger Riggs wrote: >> src/java.base/share/classes/jdk/internal/util/OperatingSystem.java line 81: >> >>> 79: */ >>> 80: AIX, >>> 81: ; >> >> So no Unknown value? > > Correct, as explained above. If additional OS values are needed, they can be adde

Re: RFR: 8304818: Prune HttpURLConnection cache when corresponding Authenticator is garbage collected

2023-03-24 Thread Daniel Jeliński
On Fri, 24 Mar 2023 14:51:25 GMT, Daniel Fuchs wrote: >> That's a good point. One solution would be to use a ConcurrentHashMap >> instead of a simple HashMap. > > jshell> var map = Map.of(1,1,2,2,3,3,4,4) > map ==> {1=1, 2=2, 3=3, 4=4} > > jshell> var map2 = new HashMap(); > map2 ==> {} > > js

Re: RFR: 8303485: Replacing os.name for operating system customization [v6]

2023-03-24 Thread Naoto Sato
On Fri, 24 Mar 2023 00:27:42 GMT, Roger Riggs wrote: >> Improvements to support OS specific customization for JDK internal use: >> - To select values and code; allowing elimination of unused code and values >> - Optionally evaluated by build processes, compilation, or archiving (i.e. >> CDS) >

Re: RFR: 8303485: Replacing os.name for operating system customization [v6]

2023-03-24 Thread Roger Riggs
On Fri, 24 Mar 2023 16:03:26 GMT, Michael Osipov wrote: >> Roger Riggs has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Rename OperatingSystem enum values to uppercase > > src/java.base/share/classes/jdk/internal/util/OperatingSystem.java

Re: RFR: 8303485: Replacing os.name for operating system customization [v6]

2023-03-24 Thread Michael Osipov
On Fri, 24 Mar 2023 00:27:42 GMT, Roger Riggs wrote: >> Improvements to support OS specific customization for JDK internal use: >> - To select values and code; allowing elimination of unused code and values >> - Optionally evaluated by build processes, compilation, or archiving (i.e. >> CDS) >

Re: RFR: 8303485: Replacing os.name for operating system customization [v6]

2023-03-24 Thread Alan Bateman
On Fri, 24 Mar 2023 00:27:42 GMT, Roger Riggs wrote: >> Improvements to support OS specific customization for JDK internal use: >> - To select values and code; allowing elimination of unused code and values >> - Optionally evaluated by build processes, compilation, or archiving (i.e. >> CDS) >

Re: RFR: 8303485: Replacing os.name for operating system customization [v6]

2023-03-24 Thread Roger Riggs
On Fri, 24 Mar 2023 16:02:59 GMT, Michael Osipov wrote: >> Roger Riggs has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Rename OperatingSystem enum values to uppercase > > src/java.base/share/classes/jdk/internal/util/OperatingSystem.java

Re: RFR: 7026262: HttpServer: improve handling of finished HTTP exchanges [v2]

2023-03-24 Thread Michael McMahon
On Fri, 24 Mar 2023 10:56:50 GMT, Daniel Jeliński wrote: >> This patch fixes the following issues with HttpHandler exception handling: >> - The connection is no longer closed if an exception is thrown after the >> response is completed. As soon as the response is completed, the connection >> is

Re: RFR: 8304818: Prune HttpURLConnection cache when corresponding Authenticator is garbage collected

2023-03-24 Thread Daniel Fuchs
On Fri, 24 Mar 2023 14:43:14 GMT, Daniel Fuchs wrote: >> src/java.base/share/classes/sun/net/www/protocol/http/AuthCacheImpl.java >> line 85: >> >>> 83:LinkedList list) -> { >>> 84: if (key.endsWith(authkey)) { >>> 85:

Re: RFR: 8304818: Prune HttpURLConnection cache when corresponding Authenticator is garbage collected

2023-03-24 Thread Daniel Fuchs
On Fri, 24 Mar 2023 13:11:00 GMT, Daniel Jeliński wrote: >> Hi, >> >> Can I get a review for this please? This change uses a Cleaner to check when >> java.net.Authenticator instances become unreachable, and then prunes the >> authentication cache for entries that correspond to that Authenticat

Re: RFR: 8304818: Prune HttpURLConnection cache when corresponding Authenticator is garbage collected

2023-03-24 Thread Daniel Jeliński
On Thu, 23 Mar 2023 15:47:10 GMT, Michael McMahon wrote: > Hi, > > Can I get a review for this please? This change uses a Cleaner to check when > java.net.Authenticator instances become unreachable, and then prunes the > authentication cache for entries that correspond to that Authenticator an

Re: RFR: 7026262: HttpServer: improve handling of finished HTTP exchanges [v2]

2023-03-24 Thread Michael McMahon
On Fri, 24 Mar 2023 11:02:08 GMT, Daniel Jeliński wrote: >> That was just a suggestion - I was a bit bothered with the hidden >> interaction between FixedLengthOutputStream and sendResponseHeaders here, >> where FixedLengthOutputStream has to trust that sendResponseHeaders has sent >> the even

Re: RFR: 7026262: HttpServer: improve handling of finished HTTP exchanges [v2]

2023-03-24 Thread Daniel Fuchs
On Fri, 24 Mar 2023 10:56:50 GMT, Daniel Jeliński wrote: >> This patch fixes the following issues with HttpHandler exception handling: >> - The connection is no longer closed if an exception is thrown after the >> response is completed. As soon as the response is completed, the connection >> is

Re: RFR: 7026262: HttpServer: improve handling of finished HTTP exchanges [v2]

2023-03-24 Thread Daniel Jeliński
On Thu, 23 Mar 2023 18:39:22 GMT, Daniel Fuchs wrote: >> Daniel Jeliński has updated the pull request incrementally with three >> additional commits since the last revision: >> >> - Explicit close no longer needed >> - Close exchange on zero-length response >> - Remove redundant closeConnect

Re: RFR: 7026262: HttpServer: improve handling of finished HTTP exchanges [v2]

2023-03-24 Thread Daniel Jeliński
On Fri, 24 Mar 2023 10:16:45 GMT, Daniel Fuchs wrote: >> `sendResponseStream` could close the stream when called with length = -1; >> the output stream is always fixed length in that case. I'd need to modify >> this class to accept zero-length writes even when closed, but I think >> there's a

Re: RFR: 7026262: HttpServer: improve handling of finished HTTP exchanges [v2]

2023-03-24 Thread Daniel Jeliński
> This patch fixes the following issues with HttpHandler exception handling: > - The connection is no longer closed if an exception is thrown after the > response is completed. As soon as the response is completed, the connection > is added back to the pool, ready for reuse. Closing the connectio

Re: RFR: 7026262: HttpServer: improve handling of finished HTTP exchanges

2023-03-24 Thread Daniel Fuchs
On Fri, 24 Mar 2023 07:39:22 GMT, Daniel Jeliński wrote: >> src/jdk.httpserver/share/classes/sun/net/httpserver/FixedLengthOutputStream.java >> line 89: >> >>> 87: // WriteFinishedEvent was sent already; nothing to do >>> 88: return; >>> 89: } >> >> Wouldn't it

Re: RFR: 7026262: HttpServer: improve handling of finished HTTP exchanges

2023-03-24 Thread Daniel Jeliński
On Thu, 23 Mar 2023 18:22:25 GMT, Daniel Fuchs wrote: >> This patch fixes the following issues with HttpHandler exception handling: >> - The connection is no longer closed if an exception is thrown after the >> response is completed. As soon as the response is completed, the connection >> is ad

Re: RFR: 7026262: HttpServer: improve handling of finished HTTP exchanges

2023-03-24 Thread Daniel Jeliński
On Thu, 23 Mar 2023 18:34:37 GMT, Daniel Fuchs wrote: >> This patch fixes the following issues with HttpHandler exception handling: >> - The connection is no longer closed if an exception is thrown after the >> response is completed. As soon as the response is completed, the connection >> is ad

Re: RFR: 7026262: HttpServer: improve handling of finished HTTP exchanges

2023-03-24 Thread Daniel Jeliński
On Thu, 23 Mar 2023 18:08:41 GMT, Daniel Fuchs wrote: >> This patch fixes the following issues with HttpHandler exception handling: >> - The connection is no longer closed if an exception is thrown after the >> response is completed. As soon as the response is completed, the connection >> is ad