[crac] RFR: Handle open file descriptors with configurable policies [v9]
Radim Vansa
rvansa at openjdk.org
Tue Jul 4 07:55:32 UTC 2023
On Mon, 3 Jul 2023 16:59:51 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:
>> Radim Vansa has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Cosmetic fixes (imports)
>
> src/java.base/share/classes/jdk/internal/crac/JDKFileResource.java line 46:
>
>> 44:
>> 45: OpenResourcePolicies.Policy policy = OpenResourcePolicies.findForPath(false, path);
>> 46: String action = policy != null ? policy.action.toLowerCase() : "error";
>
> Policies could be more "typed", e.g. an OpenFilePolicy exposing an enum with predefined actions... But this can be done in follow ups. Looks good for now.
The policies are meant to be resource-specific, therefore I didn't want to use one big enum in `OpenResourcePolicies`. It's already a stretch from the concept that `FILE`, `PIPE` and `SOCKET` are defined there.
So we could have them as constants in the resource parent, but these would be mostly used just once.
FYI, I am moving OpenResourcePolicies.findForPath to JDKFIleResource, it's not used elsewhere anyway.
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/69#discussion_r1251639633
More information about the crac-dev
mailing list