Skip to content

Conversation

@yiminc
Copy link
Member

@yiminc yiminc commented Jan 16, 2026

Summary

  • Add gRPC health check endpoint to worker service on port 7239
  • Worker service now exposes health status like frontend, history, and matching services
  • Enables Kubernetes/container orchestration health probes for worker service

Changes

  • Add server, grpcListener, healthServer fields to worker Service struct
  • Register health server in Start() with SERVING status
  • Set NOT_SERVING status and gracefully stop in Stop()
  • Add ServerProvider in fx.go for dependency injection
  • Add unit test for health check functionality

Test plan

  • Unit test TestHealthCheck passes
  • Linting passes
  • Manual test against local server:
    $ grpcurl -plaintext -d '{"service": "temporal.api.workflowservice.v1.WorkerService"}' localhost:7239 grpc.health.v1.Health/Check
    {
    "status": "SERVING"
    }

Fixes #2582

🤖 Generated with Claude Code

@yiminc yiminc requested review from a team as code owners January 16, 2026 06:28
@yiminc yiminc marked this pull request as draft January 17, 2026 01:06
@yiminc yiminc force-pushed the add-worker-health-check branch from 3f43e72 to c13a110 Compare January 17, 2026 01:24
Add gRPC health check support to the worker service on port 7239.
The health check follows the same pattern as other Temporal services,
reporting SERVING status when started and NOT_SERVING when stopped.

Includes an integration test that verifies health check is properly
wired up through the NewService() lifecycle.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@yiminc yiminc force-pushed the add-worker-health-check branch from c13a110 to ef5ab04 Compare January 17, 2026 01:25
@yiminc yiminc marked this pull request as ready for review January 17, 2026 01:26
Remove the mock-heavy unit test TestNewServiceHealthCheck and replace it
with a functional test that makes real gRPC health check calls against
a running worker service. This eliminates the maintenance burden of
updating mocks when new dependencies are added to the worker service.

Changes:
- Add WorkerGRPCAddress() method to expose worker service address
- Add TestWorkerServiceHealthCheck functional test
- Remove service/worker/service_test.go

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add health check handler for worker service

3 participants