sdk-php icon indicating copy to clipboard operation
sdk-php copied to clipboard

Lazy connectivity for Temporal client and healthCheck

Open bergundy opened this issue 3 years ago • 8 comments

SDK should have a lazy and eager way to create a client and expose a healthcheck method

ref: https://github.com/temporalio/sdk-php/issues/223

bergundy avatar Aug 03 '22 17:08 bergundy

The SDK healthcheck goes though the already open client on RR side. A.k.a. it should aready work as expected and not create any excessive connections.

wolfy-j avatar Oct 18 '22 12:10 wolfy-j

Does PHP client support lazy and eager creation? Does it call getSystemInfo on connection? Is the gRPC health service exposed via the client?

We have all of that in the other SDKs.

bergundy avatar Nov 17 '22 01:11 bergundy

Not at the moment. We also don't have dial() routine in PHP, it happens inside underlyling C library.

@roxblnfk We will work on RFC based on https://github.com/temporalio/sdk-features/issues/45

wolfy-j avatar Nov 22 '22 10:11 wolfy-j

With the release of 2.7.0, interceptor functionality will be introduced. Along with this, the SystemInfoInterceptor is added, which calls getSystemInfo() and getCapabilities() on the first client request.

This interceptor is not added by default, but we can do this - add SystemInfoInterceptor if the user has not specified their list of interceptors for client calls. If the user wants to disable the interceptor, they can simply pass an empty list. @wolfy-j @Sushisource what do you think about this?

roxblnfk avatar Dec 13 '23 09:12 roxblnfk

Regarding gRPC HealthCheck - it's not supported by the PHP gRPC extension. https://grpc.io/docs/guides/health-checking/#language-support

roxblnfk avatar Dec 13 '23 09:12 roxblnfk

@bergundy do we expect HealthCheck mostly in Activity and WF pollers or client code as well? We do have health checks for all the pollers, but PHP does not have a BG check mechanism for clients.

wolfy-j avatar Dec 13 '23 17:12 wolfy-j

In other languages we have a lazy method to create a connection (client) that doesn't make any calls to the server, and an eager connection method that fails if getSystemInfo fails. We also expose the gRPC heath service in the client for users that want to call that.

That's all I requested in this issue.

bergundy avatar Dec 13 '23 19:12 bergundy

Eager connect on demand (lazy) - done (in fact in PHP this is the default way how GRPC works) getSystemInfo - done with 2.7

I think we are good there.

wolfy-j avatar Dec 13 '23 19:12 wolfy-j