Re: RFR: JDK-8314272: Improve java.util.prefs.BackingStoreException: Couldn't get file lock. [v2]

2023-09-01 Thread Matthias Baesken
> We run into some BackingStoreException: Couldn't get file lock. e.g. here : > > [JShell] Exception in thread "main" java.lang.IllegalStateException: > java.util.prefs.BackingStoreException: Couldn't get file lock. > [JShell] at > jdk.jshell/jdk.internal.jshell.tool.JShellToolBuilder$Preference

Re: RFR: JDK-8314272: Improve java.util.prefs.BackingStoreException: Couldn't get file lock. [v2]

2023-09-01 Thread Martin Doerr
On Fri, 1 Sep 2023 12:36:28 GMT, Matthias Baesken wrote: >> We run into some BackingStoreException: Couldn't get file lock. e.g. here : >> >> [JShell] Exception in thread "main" java.lang.IllegalStateException: >> java.util.prefs.BackingStoreException: Couldn't get file lock. >> [JShell] at >>

Re: RFR: JDK-8314272: Improve java.util.prefs.BackingStoreException: Couldn't get file lock. [v2]

2023-09-01 Thread Alan Bateman
On Fri, 1 Sep 2023 12:36:28 GMT, Matthias Baesken wrote: >> We run into some BackingStoreException: Couldn't get file lock. e.g. here : >> >> [JShell] Exception in thread "main" java.lang.IllegalStateException: >> java.util.prefs.BackingStoreException: Couldn't get file lock. >> [JShell] at >>

Re: RFR: JDK-8314272: Improve java.util.prefs.BackingStoreException: Couldn't get file lock. [v2]

2023-09-01 Thread Matthias Baesken
On Fri, 1 Sep 2023 12:36:28 GMT, Matthias Baesken wrote: >> We run into some BackingStoreException: Couldn't get file lock. e.g. here : >> >> [JShell] Exception in thread "main" java.lang.IllegalStateException: >> java.util.prefs.BackingStoreException: Couldn't get file lock. >> [JShell] at >>

Re: RFR: JDK-8314272: Improve java.util.prefs.BackingStoreException: Couldn't get file lock. [v2]

2023-09-01 Thread Matthias Baesken
On Fri, 1 Sep 2023 12:36:28 GMT, Matthias Baesken wrote: >> We run into some BackingStoreException: Couldn't get file lock. e.g. here : >> >> [JShell] Exception in thread "main" java.lang.IllegalStateException: >> java.util.prefs.BackingStoreException: Couldn't get file lock. >> [JShell] at >>

Re: RFR: JDK-8314272: Improve java.util.prefs.BackingStoreException: Couldn't get file lock. [v2]

2023-09-01 Thread Matthias Baesken
On Fri, 1 Sep 2023 12:36:28 GMT, Matthias Baesken wrote: >> We run into some BackingStoreException: Couldn't get file lock. e.g. here : >> >> [JShell] Exception in thread "main" java.lang.IllegalStateException: >> java.util.prefs.BackingStoreException: Couldn't get file lock. >> [JShell] at >>

Re: RFR: JDK-8314272: Improve java.util.prefs.BackingStoreException: Couldn't get file lock. [v2]

2023-09-01 Thread Alan Bateman
On Fri, 1 Sep 2023 13:10:19 GMT, Matthias Baesken wrote: > Hi Alan , Your assumption 'I assume the use of System.getProperty is > problematic when running with a SM.' is most likely correct. You'll need to test with a SM that denies reading the system property to be sure. There are classes in

Re: RFR: JDK-8314272: Improve java.util.prefs.BackingStoreException: Couldn't get file lock. [v2]

2023-09-04 Thread Matthias Baesken
On Fri, 1 Sep 2023 13:27:58 GMT, Alan Bateman wrote: > > Hi Alan , Your assumption 'I assume the use of System.getProperty is > > problematic when running with a SM.' is most likely correct. > > You'll need to test with a SM that denies reading the system property to be > sure. There are class

Re: RFR: JDK-8314272: Improve java.util.prefs.BackingStoreException: Couldn't get file lock. [v2]

2023-09-08 Thread Alan Bateman
On Mon, 4 Sep 2023 11:57:47 GMT, Matthias Baesken wrote: >>> Hi Alan , Your assumption 'I assume the use of System.getProperty is >>> problematic when running with a SM.' is most likely correct. >> >> You'll need to test with a SM that denies reading the system property to be >> sure. There ar

Re: RFR: JDK-8314272: Improve java.util.prefs.BackingStoreException: Couldn't get file lock. [v2]

2023-09-08 Thread Matthias Baesken
On Fri, 8 Sep 2023 07:19:55 GMT, Alan Bateman wrote: > we shouldn't be hardcoding the values of error numbers like this. Then print the good old int value and rely on OS tools to convert this, it is rather easy and available on some distros). Or move the current error-code handling code from ni

Re: RFR: JDK-8314272: Improve java.util.prefs.BackingStoreException: Couldn't get file lock. [v2]

2023-09-08 Thread Alan Bateman
On Fri, 8 Sep 2023 07:44:21 GMT, Matthias Baesken wrote: > We could do this mid-term in some follow up action. It shouldn't be hard to try it. If it works out then it would mean this old crufty code goes away and the JDK is in a better place. If it doesn't work out then the a plan B would be t

Re: RFR: JDK-8314272: Improve java.util.prefs.BackingStoreException: Couldn't get file lock. [v2]

2023-09-08 Thread Brent Christian
On Fri, 8 Sep 2023 08:03:51 GMT, Alan Bateman wrote: > > We could do this mid-term in some follow up action. > > It shouldn't be hard to try it. If it works out then it would mean this old > crufty code goes away and the JDK is in a better place. If it doesn't work > out then the a plan B woul

Re: RFR: JDK-8314272: Improve java.util.prefs.BackingStoreException: Couldn't get file lock. [v2]

2023-09-09 Thread Alan Bateman
On Fri, 8 Sep 2023 18:45:02 GMT, Brent Christian wrote: > I would also like to see what a FileChannel implementation looks like. Am I > right that this would allow the `prefs` native library to be removed entirely? Yes. FileChannel.open can be called with the file permissions to atomically set