[GH-ISSUE #445] [FEATURE REQUEST] expose backend Health in client & server #204

Open
opened 2026-03-02 05:19:35 +03:00 by kerem · 5 comments
Owner

Originally created by @a5r0n on GitHub (Apr 30, 2022).
Original GitHub issue: https://github.com/hibiken/asynq/issues/445

Originally assigned to: @hibiken on GitHub.

Is your feature request related to a problem? Please describe.
to manage app lifecycle, we need to know when to restart some services

Describe the solution you'd like
exposing backend services health (like the Redis connection) should do the trick

@hibiken do u accept PR for this?
Any thoughts how to implement?
NB, i quite new in go, so i need some guidance

Originally created by @a5r0n on GitHub (Apr 30, 2022). Original GitHub issue: https://github.com/hibiken/asynq/issues/445 Originally assigned to: @hibiken on GitHub. **Is your feature request related to a problem? Please describe.** to manage app lifecycle, we need to know when to restart some services **Describe the solution you'd like** exposing backend services health (like the Redis connection) should do the trick @hibiken do u accept PR for this? Any thoughts how to implement? NB, i quite new in go, so i need some guidance
Author
Owner

@hibiken commented on GitHub (May 10, 2022):

@a5r0n Thank you for opening this issue!

I want to do a bit more research around how we should do health checking / export health status, etc.
I'll get back to you soon 👍

<!-- gh-comment-id:1122363071 --> @hibiken commented on GitHub (May 10, 2022): @a5r0n Thank you for opening this issue! I want to do a bit more research around how we should do health checking / export health status, etc. I'll get back to you soon 👍
Author
Owner

@gbolo commented on GitHub (Aug 26, 2022):

@a5r0n Thank you for opening this issue!

I want to do a bit more research around how we should do health checking / export health status, etc. I'll get back to you soon +1

@hibiken how about just a basic redis ping/connection check like the server has right now, exposed through the callback function passed in the server config

// Config specifies the server's background-task processing behavior.
type Config struct {
...
	// HealthCheckFunc is called periodically with any errors encountered during ping to the
	// connected redis server.
	HealthCheckFunc func(error)

	// HealthCheckInterval specifies the interval between healthchecks.
	//
	// If unset or zero, the interval is set to 15 seconds.
	HealthCheckInterval time.Duration
...
}

This seems to work very good for me on the server side. Would love to have the same on the client side ;)

<!-- gh-comment-id:1228606663 --> @gbolo commented on GitHub (Aug 26, 2022): > @a5r0n Thank you for opening this issue! > > I want to do a bit more research around how we should do health checking / export health status, etc. I'll get back to you soon +1 @hibiken how about just a basic redis ping/connection check like the server has right now, exposed through the callback function passed in the server config ``` // Config specifies the server's background-task processing behavior. type Config struct { ... // HealthCheckFunc is called periodically with any errors encountered during ping to the // connected redis server. HealthCheckFunc func(error) // HealthCheckInterval specifies the interval between healthchecks. // // If unset or zero, the interval is set to 15 seconds. HealthCheckInterval time.Duration ... } ``` This seems to work very good for me on the server side. Would love to have the same on the client side ;)
Author
Owner

@al-bglhk commented on GitHub (Sep 14, 2022):

This seems to work very good for me on the server side. Would love to have the same on the client side ;)

How did you do that? Any sample codes please?

I'm creating an app in a cluster, and I need to expose some liveliness probes. Is there something ready-to-use from asynq? Otherwise, I'll just spin a small http server.

<!-- gh-comment-id:1246775703 --> @al-bglhk commented on GitHub (Sep 14, 2022): > This seems to work very good for me on the server side. Would love to have the same on the client side ;) How did you do that? Any sample codes please? I'm creating an app in a cluster, and I need to expose some liveliness probes. Is there something ready-to-use from asynq? Otherwise, I'll just spin a small http server.
Author
Owner

@pbarnum commented on GitHub (Dec 13, 2022):

I personally would love to ping Redis (through the Asynq Client/Server) directly instead of relying on Asynq's callback function to do this for me. I have multiple dependencies performing health checks for my service and each one of them provide a direct function call that I can fanout. However for Asynq, I need to rely on the "latest" status returned, which may end up being stale at that point.

<!-- gh-comment-id:1349994578 --> @pbarnum commented on GitHub (Dec 13, 2022): I personally would love to ping Redis (through the Asynq Client/Server) directly instead of relying on Asynq's callback function to do this for me. I have multiple dependencies performing health checks for my service and each one of them provide a direct function call that I can fanout. However for Asynq, I need to rely on the "latest" status returned, which may end up being stale at that point.
Author
Owner

@pbarnum commented on GitHub (Jan 5, 2023):

Hey @hibiken, I'm bumping this thread to see if you had a chance to consider my last message. I also tagged this issue in a PR I submitted a few weeks back.

<!-- gh-comment-id:1372882973 --> @pbarnum commented on GitHub (Jan 5, 2023): Hey @hibiken, I'm bumping this thread to see if you had a chance to consider my last message. I also tagged this issue in a PR I submitted a few weeks back.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asynq#204
No description provided.