[crac] RFR: 8371549: [CRaC] Implement C/R in Selector on non-Linux [v2]

Radim Vansa rvansa at openjdk.org
Wed Jan 7 18:42:52 UTC 2026


On Mon, 5 Jan 2026 09:59:08 GMT, Timofei Pushkin <tpushkin at openjdk.org> wrote:

>> Radim Vansa has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Set FD value on Windows, too
>
> src/java.base/share/classes/jdk/internal/crac/ClaimedFDs.java line 89:
> 
>> 87:                         assert fileDescriptorAccess.getHandle(entry.getKey()) != -1;
>> 88:                         // On Windows the native FDs check is a no-op, but we need to set
>> 89:                         // the FD to prevent assertion failure on Descriptor.getFd()
> 
> Maybe allow -1 as a value? Having 0 may be confusing as it is a valid FD value.
> 
> In the future, it looks like we need a more general abstraction for FD/handle.

It is strange to allow -1 in a 'valid' Descriptor. And on Linux, which is our 'main' platform this does not happen - I think it is better to keep it this way. I could do `fd = Integer.MAX_VALUE` to differentiate this from stdin = 0.

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

PR Review Comment: https://git.openjdk.org/crac/pull/276#discussion_r2669658363


More information about the crac-dev mailing list