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

Anton Kozlov akozlov at openjdk.org
Fri Jun 9 15:20:13 UTC 2023


On Fri, 9 Jun 2023 09:39:31 GMT, Radim Vansa <duke at openjdk.org> wrote:

> So, this is to support implementation on other platforms where you can't read what is the FD/handle pointing to? What platform is lacking this info?

I'm really not sure about Windows. With this, Socket details will be reported on Windows without additional code for reporting.

> With Socket, you can get the IPs and ports. JVM is mostly providing API for accessing OS-level info. The same for files. But you can get that info quite easily on the FD level without a hierarchical claiming.

That requires additional code in the FD that needs know all possible file descriptors types on the system, and new interfaces to extract information from them, like you had to do with Sockets.

> Maybe if the API allowed claiming ownership of any object, rather than just FD (that would be propagated), and you'd provide information from all chain elements (rather than just the topmost).

Yes, I also started thinking about something like this. That may work. We'll have a chance to polish the ClaimFd interface with concrete examples.

> But can you really present a real-world case where the changes that you're introducing get useful?

Since when this become a prerequisite? :) Refactorings and non-functional changes are fine for CRaC Project.

Before the patch, claimFdWeak and claimFd were proto versions of this claming. And you can see, they required "external" orderding between multiple claimers, thus we had PRE_FILE_DESCRIPTOR and NATIVE_PRNG priorities before FILE_DESRIPTOR, to override FileDescriptors throwing an exception. That did not scale well.

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

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


More information about the crac-dev mailing list