vert-x3 / vertx-grpc

gRPC for Vert.x
78 stars 49 forks source link

Close GRPC server during CRaC snapshotting #139

Open rvansa opened 1 year ago

rvansa commented 1 year ago

This change intends to support an application using Vertx GRPC server to perform the Checkpoint and Restore on JVM implementing this, specifically using OpenJDK CRaC or future versions of OpenJDK. Package org.crac is a facade that either forwards the invocation to actual implementation or provides a no-op implementation.

rvansa commented 1 year ago

I've updated my Eclipse Foundation profile to correctly reflect that this is under CLA for Azul Systems (also EF member) - I no longer work for Red Hat.

rvansa commented 1 year ago

Any feedback on this?

vietj commented 1 year ago

I would like to avoid a dependency on the project, is that possible to do that in a way it's decoupled from the project ? (like an extra jar)

rvansa commented 1 year ago

@vietj We need to register the existence of the server somewhere; it'd be difficult to hook into creation of the instance from the external library. The code in the dependency is actually very lightweight - it checks (using reflection) if CRaC is supported on the platform, delegates to the implementation and if it's not present the operations are no-op. It is meant as a bridge until the support lands in mainstream JDK and even then to shield projects from requiring to baseline on recent JDK.

It could be possible to register the server in the place where this is created (app, or some integration code in a framework) but our goal is to push it as low as possible in the technology stack to provide biggest fanout to the consuming projects. I've looked into GRPC library but integration there would be complex due to some synchronization required; in case of Vertx-server the changes are pretty trivial as we can use the eventloop pattern.

Btw. CRaC already got some basic support in Quarkus (though Q already has a ton of deps while I understand your desire to keep the dependency set clean and tiny).

rvansa commented 1 year ago

I've updated the dependency maven coordinates io.github.crac -> org.crac (we've released this with proper own domain).