[crac] RFR: Move more FD tracking to java layer [v2]

Anton Kozlov akozlov at openjdk.org
Mon Jun 12 12:13:18 UTC 2023

On Mon, 12 Jun 2023 08:26:02 GMT, Radim Vansa <duke at openjdk.org> wrote:

> you haven't removed the socket-describing code and you won't, as there are cases where sockets are created natively without the Socket class and you still want to show info about those.

The native FileDescriptor is not employed in this scenario, the native descriptor detection is done by JVM, that code is mostly unchanged.

> ... and this is present again, but this time in the native code. I was trying to extract the bits in a form that Java understands, though getting them was not a one-liner in the native, so I understand that it might be tempting to just format that in native as well and have fewer native methods. I was hoping for eventual reuse.

As said, FileDescriptor provides a minimal descriptor for JDK debugging itself. At some point the code had no reporting [1], original JVM reporting [2], and the reporting aligned with the current state [3]. I'm fine with all of them, actually.

[1] https://github.com/openjdk/crac/pull/79/commits/78d8e0b09a232c559ded14a4602c691b9d51aa36
[2] a change prior [1]
[3] https://github.com/openjdk/crac/pull/79/commits/8db2fe487e4a45909351f8de2c8bff881f3d7f93

> Two points:
> * having a case where this is actually helpful explains the general reasoning behind the refactoring

Let's conclude on Socket is what user creates, not FileDescriptor (see the PR description)

> * the example can help verifying that the changes are complete (to an extent)

There should be no major drawback. Can you see something?

> The NATIVE_PRNG priority is still present, do you expect to remove those in a follow up?

No, I don't see it's should be done. NATIVE_PRNG is still there to handle RNG state, independent of FDs.

> I am worried that while you have 'simplified' some parts in FileDescriptor #69 would reintroduce those

I think rebasing #69 on top of this would benefit the implementations of the policies, it will make them cleaner and more roboust. E.g. policy implementaiton in File can also prevent access to FileDescriptor with CLOSE policy, during small time window between the point FD is closed, but checkpoint is not started yet.


PR Comment: https://git.openjdk.org/crac/pull/79#issuecomment-1587211492

More information about the crac-dev mailing list