[crac] RFR: Handle open file descriptors with configurable policies [v14]

Anton Kozlov akozlov at openjdk.org
Wed Jul 19 11:56:08 UTC 2023


On Wed, 19 Jul 2023 09:59:26 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:

>> Radim Vansa has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix windows tests
>
> src/java.base/share/classes/java/io/FileDescriptor.java line 93:
> 
>> 91:                     case "ignore":
>> 92:                         if (Boolean.parseBoolean(warn)) {
>> 93:                             LoggerContainer.warn("File descriptor {0} was not closed by the application. Use 'warn: false' in the policy to suppress this message.", fd);
> 
> The suggestion is repeated for every ignored object, and for every ignored type. Is it possible to print the suggestion once and remove the duplication in the code as well?
> 
> 
> Jul 19, 2023 12:50:13 PM jdk.internal.crac.LoggerContainer warn
> WARNING: File descriptor 2 was not closed by the application. Use warn: false in the policy to suppress this message.
> java.io.FileDescriptor$Resource(FD 1) beforeCheckpoint
> Jul 19, 2023 12:50:13 PM jdk.internal.crac.LoggerContainer warn
> WARNING: File descriptor 1 was not closed by the application. Use warn: false in the policy to suppress this message.
> java.io.FileDescriptor$Resource(FD 0) beforeCheckpoint
> Jul 19, 2023 12:50:13 PM jdk.internal.crac.LoggerContainer warn
> 
> 
> src/java.base/unix/classes/sun/nio/ch/PipeImpl.java
> 70:                        LoggerContainer.warn("{0} was not closed by the application. Use 'warn: false' in the policy to suppress this message.", this);
> 
> src/java.base/share/classes/java/lang/Process.java
> 876:                        LoggerContainer.warn("{0} was not closed by the application. Use 'warn: false' in the policy to suppress this message.", this);
> 
> src/java.base/share/classes/java/io/FileDescriptor.java
> 94:                            LoggerContainer.warn("File descriptor {0} was not closed by the application. Use 'warn: false' in the policy to suppress this message.", fd);
> 
> src/java.base/share/classes/jdk/internal/crac/JDKFileResource.java
> 85:                    LoggerContainer.warn("File {0} was not closed by the application. Use 'warn: false' in the policy to suppress this message.", path);
> 
> src/java.base/share/classes/jdk/internal/crac/JDKSocketResourceBase.java
> 54:                        LoggerContainer.warn("Socket {0} was not closed by the application. Use 'warn: false' in the policy to suppress this message.", owner);

Thank you for removing the code duplication. Could you also print the hint only once? Now it's still

Jul 19, 2023 2:50:54 PM jdk.internal.crac.LoggerContainer warn
WARNING: File descriptor 2 was not closed by the application. Use warn: false in the policy to suppress this message.
Jul 19, 2023 2:50:54 PM jdk.internal.crac.LoggerContainer warn
WARNING: File descriptor 1 was not closed by the application. Use warn: false in the policy to suppress this message.
Jul 19, 2023 2:50:54 PM jdk.internal.crac.LoggerContainer warn
WARNING: File descriptor 0 was not closed by the application. Use warn: false in the policy to suppress this message.

-------------

PR Review Comment: https://git.openjdk.org/crac/pull/69#discussion_r1267964629


More information about the crac-dev mailing list