CancelledKeyException during channel registration

2022-05-31 Thread Gillespie, Oli
Hi, I noticed this surprising (to me) behaviour, and wonder whether it's expected or could be considered a bug. I'm not an expert in this area so apologies if this is trivial. When registering a SocketChannel with a Selector for the first time, it's possible to get a CancelledKeyException ev

Re: RFR: 8287318: ConcurrentModificationException in sun.net.httpserver.ServerImpl$Dispatcher

2022-05-31 Thread Daniel Fuchs
On Thu, 26 May 2022 07:17:12 GMT, Jaikiran Pai wrote: > Can I please get a review of this change which addresses the issue noted in > https://bugs.openjdk.java.net/browse/JDK-8287318? > > The `ServerImpl` has a `Dispatcher` thread which uses a `Selector` to select > keys of interested. The sel

Re: CancelledKeyException during channel registration

2022-05-31 Thread Alan Bateman
Moving to the nio-dev list. Registration is not an atomic operation. The channel is registered (this creates the selection key) and then the key's interest set is changed. If I read your test case correctly, it is cancelling the key before the key's interest set is changed and this leads to

Re: RFR: 8287318: ConcurrentModificationException in sun.net.httpserver.ServerImpl$Dispatcher [v2]

2022-05-31 Thread Jaikiran Pai
> Can I please get a review of this change which addresses the issue noted in > https://bugs.openjdk.java.net/browse/JDK-8287318? > > The `ServerImpl` has a `Dispatcher` thread which uses a `Selector` to select > keys of interested. The selected keys is then iterated over and each key is > remo

Re: RFR: 8287318: ConcurrentModificationException in sun.net.httpserver.ServerImpl$Dispatcher [v2]

2022-05-31 Thread Daniel Fuchs
On Tue, 31 May 2022 15:11:03 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which addresses the issue noted in >> https://bugs.openjdk.java.net/browse/JDK-8287318? >> >> The `ServerImpl` has a `Dispatcher` thread which uses a `Selector` to select >> keys of interested. Th

Re: RFR: 8287318: ConcurrentModificationException in sun.net.httpserver.ServerImpl$Dispatcher [v2]

2022-05-31 Thread Jaikiran Pai
On Tue, 31 May 2022 14:51:48 GMT, Daniel Fuchs wrote: >> Jaikiran Pai has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Use Collection.toArray(...) instead of creating a copy of the collection > > src/jdk.httpserver/share/classes/sun/net/h

Re: RFR: 8287237: (fs) Files.probeContentType returns null if filename contains hash mark on Linux [v2]

2022-05-31 Thread Brian Burkhalter
On Sat, 28 May 2022 14:39:16 GMT, Jaikiran Pai wrote: >> Brian Burkhalter has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8287237: Refactor and clean up > > src/java.base/share/classes/sun/net/www/MimeTable.java line 188: > >> 186:

Re: RFR: 8287237: (fs) Files.probeContentType returns null if filename contains hash mark on Linux [v2]

2022-05-31 Thread Brian Burkhalter
On Tue, 31 May 2022 16:41:57 GMT, Brian Burkhalter wrote: >> src/java.base/share/classes/sun/net/www/MimeTable.java line 188: >> >>> 186: int hashIndex = fname.lastIndexOf(HASH_MARK); >>> 187: if (hashIndex > 0) { >>> 188: String ext = getFileExtension(fname.substring

Re: RFR: 8287237: (fs) Files.probeContentType returns null if filename contains hash mark on Linux [v3]

2022-05-31 Thread Brian Burkhalter
> Modify `sun.net.www.MimeTable.findByFileName(String)` to attempt to find the > file extension in the entire file name if it is not found in the portion of > the name preceding the optional fragment beginning with a hash (`#`). Brian Burkhalter has updated the pull request incrementally with on

Re: RFR: 8287237: (fs) Files.probeContentType returns null if filename contains hash mark on Linux [v4]

2022-05-31 Thread Brian Burkhalter
> Modify `sun.net.www.MimeTable.findByFileName(String)` to attempt to find the > file extension in the entire file name if it is not found in the portion of > the name preceding the optional fragment beginning with a hash (`#`). Brian Burkhalter has updated the pull request incrementally with on

Re: RFR: 8287237: (fs) Files.probeContentType returns null if filename contains hash mark on Linux [v4]

2022-05-31 Thread Roger Riggs
On Tue, 31 May 2022 18:29:30 GMT, Brian Burkhalter wrote: >> Modify `sun.net.www.MimeTable.findByFileName(String)` to attempt to find the >> file extension in the entire file name if it is not found in the portion of >> the name preceding the optional fragment beginning with a hash (`#`). > > B

Re: RFR: 8287237: (fs) Files.probeContentType returns null if filename contains hash mark on Linux [v4]

2022-05-31 Thread Jaikiran Pai
On Tue, 31 May 2022 18:29:30 GMT, Brian Burkhalter wrote: >> Modify `sun.net.www.MimeTable.findByFileName(String)` to attempt to find the >> file extension in the entire file name if it is not found in the portion of >> the name preceding the optional fragment beginning with a hash (`#`). > > B

Re: RFR: 8287318: ConcurrentModificationException in sun.net.httpserver.ServerImpl$Dispatcher [v2]

2022-05-31 Thread Jaikiran Pai
On Tue, 31 May 2022 15:14:22 GMT, Jaikiran Pai wrote: >> Can I please get a review of this change which addresses the issue noted in >> https://bugs.openjdk.java.net/browse/JDK-8287318? >> >> The `ServerImpl` has a `Dispatcher` thread which uses a `Selector` to select >> keys of interested. Th

Integrated: 8287318: ConcurrentModificationException in sun.net.httpserver.ServerImpl$Dispatcher

2022-05-31 Thread Jaikiran Pai
On Thu, 26 May 2022 07:17:12 GMT, Jaikiran Pai wrote: > Can I please get a review of this change which addresses the issue noted in > https://bugs.openjdk.java.net/browse/JDK-8287318? > > The `ServerImpl` has a `Dispatcher` thread which uses a `Selector` to select > keys of interested. The sel

Re: RFR: 8287390: Cleanup Map usage in AuthenticationInfo.requestAuthentication

2022-05-31 Thread Jaikiran Pai
On Sat, 30 Apr 2022 10:17:43 GMT, Andrey Turbanov wrote: > `AuthenticationInfo.requestAuthentication` uses separate `HashMap`'s `get` > +`put` calls. > > https://github.com/openjdk/jdk/blob/176bb23de18d9ab448e77e85a9c965a7c02f2c50/src/java.base/share/classes/sun/net/www/protocol/http/Authentica