Re: RFR: 8302845: Replace finalizer usage in JNDI DNS provider with Cleaner [v4]

2023-05-09 Thread Daniel Fuchs
On Tue, 9 May 2023 13:20:28 GMT, Aleksei Efimov wrote: >> JNDI `DnsClient` has a finalize method to close its internal datagram >> channel selector. >> The change proposed here replaces it with a cleaner to close the selector >> once the `DnsClient` >> instance becomes phantom reachable. >>

Re: RFR: 8302845: Replace finalizer usage in JNDI DNS provider with Cleaner [v4]

2023-05-09 Thread Daniel JeliƄski
On Tue, 9 May 2023 13:20:28 GMT, Aleksei Efimov wrote: >> JNDI `DnsClient` has a finalize method to close its internal datagram >> channel selector. >> The change proposed here replaces it with a cleaner to close the selector >> once the `DnsClient` >> instance becomes phantom reachable. >>

Re: RFR: 8302845: Replace finalizer usage in JNDI DNS provider with Cleaner [v4]

2023-05-09 Thread Aleksei Efimov
> JNDI `DnsClient` has a finalize method to close its internal datagram channel > selector. > The change proposed here replaces it with a cleaner to close the selector > once the `DnsClient` > instance becomes phantom reachable. > > The change was tested with `jdk-tier1` to `jdk-tier3` test

Re: RFR: 8302845: Replace finalizer usage in JNDI DNS provider with Cleaner [v3]

2023-05-08 Thread Aleksei Efimov
> JNDI `DnsClient` has a finalize method to close its internal datagram channel > selector. > The change proposed here replaces it with a cleaner to close the selector > once the `DnsClient` > instance becomes phantom reachable. > > The change was tested with `jdk-tier1` to `jdk-tier3` test

Re: RFR: 8302845: Replace finalizer usage in JNDI DNS provider with Cleaner [v2]

2023-05-08 Thread Aleksei Efimov
On Sat, 6 May 2023 12:47:21 GMT, Alan Bateman wrote: >> src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsClient.java line 165: >> >>> 163: // when this DNS client becomes phantom reachable >>> 164: Selector sel = udpChannelSelector; >>> 165: CleanerFactory.cleaner().r

Re: RFR: 8302845: Replace finalizer usage in JNDI DNS provider with Cleaner [v2]

2023-05-06 Thread Alan Bateman
On Sat, 6 May 2023 09:50:06 GMT, Daniel Fuchs wrote: > I believe this is not quite right. The Cleanable returned by the `register` > method should be saved in a final field. And close() below should call > `Cleanable::clean` instead of `udpChannelSelector.close()` Selector::close is idempotent

Re: RFR: 8302845: Replace finalizer usage in JNDI DNS provider with Cleaner [v2]

2023-05-06 Thread Daniel Fuchs
On Fri, 5 May 2023 19:08:27 GMT, Aleksei Efimov wrote: >> JNDI `DnsClient` has a finalize method to close its internal datagram >> channel selector. >> The change proposed here replaces it with a cleaner to close the selector >> once the `DnsClient` >> instance becomes phantom reachable. >>

Re: RFR: 8302845: Replace finalizer usage in JNDI DNS provider with Cleaner [v2]

2023-05-05 Thread Alan Bateman
On Fri, 5 May 2023 19:08:27 GMT, Aleksei Efimov wrote: >> JNDI `DnsClient` has a finalize method to close its internal datagram >> channel selector. >> The change proposed here replaces it with a cleaner to close the selector >> once the `DnsClient` >> instance becomes phantom reachable. >>

Re: RFR: 8302845: Replace finalizer usage in JNDI DNS provider with Cleaner [v2]

2023-05-05 Thread Aleksei Efimov
> JNDI `DnsClient` has a finalize method to close its internal datagram channel > selector. > The change proposed here replaces it with a cleaner to close the selector > once the `DnsClient` > instance becomes phantom reachable. > > The change was tested with `jdk-tier1` to `jdk-tier3` test

Re: RFR: 8302845: Replace finalizer usage in JNDI DNS provider with Cleaner [v2]

2023-05-05 Thread Aleksei Efimov
On Fri, 5 May 2023 18:13:29 GMT, Alan Bateman wrote: >> Aleksei Efimov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> fix comment > > src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsClient.java line 163: > >> 161: } >> 162

Re: RFR: 8302845: Replace finalizer usage in JNDI DNS provider with Cleaner

2023-05-05 Thread Alan Bateman
On Fri, 5 May 2023 17:25:38 GMT, Aleksei Efimov wrote: > JNDI `DnsClient` has a finalize method to close its internal datagram channel > selector. > The change proposed here replaces it with a cleaner to close the selector > once the `DnsClient` > instance becomes phantom reachable. > > Th

RFR: 8302845: Replace finalizer usage in JNDI DNS provider with Cleaner

2023-05-05 Thread Aleksei Efimov
JNDI `DnsClient` has a finalize method to close its internal datagram channel selector. The change proposed here replaces it with a cleaner to close the selector once the `DnsClient` instance becomes phantom reachable. The change was tested with `jdk-tier1` to `jdk-tier3` test sets which sho