You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to create a server with two services and a HealthCheck in each one, so I can check them independently and use reflection to know the methods exposed in each one. I have hardcoded one service as NOT_SERVING to test it, however, for some reason, it is not working. I would appreciate some help.
I have created a short script to reproduce this result.
Please forums such as grpcio google group or stack overflow for questions like these so that the wider community might be able to help. I'm gonna go ahead and close this but I'll tag @lidizheng and @gnossen for a post-close answer.
fromgrpc_health.v1importhealth, health_pb2, health_pb2_grpchealth_servicer=HealthServicer()
# You can set the health status upfront or dynamically in other parts of the applicationhealth_servicer.set("helloworld.Greeter", health_pb2.HealthCheckResponse.NOT_SERVING)
server= ...
health_pb2_grpc.add_HealthServicer_to_server(health_servicer, server)
The full service name is proto package name + the service name, you can find it in the generated code (example).
I am trying to create a server with two services and a HealthCheck in each one, so I can check them independently and use reflection to know the methods exposed in each one. I have hardcoded one service as NOT_SERVING to test it, however, for some reason, it is not working. I would appreciate some help.
I have created a short script to reproduce this result.
The proto file definition:
The Python server:
When I test the reflection and the server methods, it works:
The reflections report the proper methods and the server the correct response.
The HealthCheck on the server and the Greeter service work too:
So, it reports SERVING as expected.
However, the HealthCheck on the Byeer service, and whatever other name I use, also reports SERVING:
And I would expect NOT_SERVING.
Any idea?
Thanks in advance.
The text was updated successfully, but these errors were encountered: