Skip to content

Conversation

@nnnkkk7
Copy link
Contributor

@nnnkkk7 nnnkkk7 commented Oct 16, 2025

Summary

This PR improves Redis health check context handling to prevent goroutine leaks and ensure proper timeout enforcement during health checks and graceful shutdown.

Problem

Issue 1: Redis v3 health check ignores context

The Redis v3 client health check was using context.TODO() instead of the passed context, causing:

  • Goroutine leaks when Redis may becomes unresponsive
  • No timeout enforcement - health checks could hang indefinitely
  • Delayed shutdown - goroutines can continue running during graceful shutdown

Issue 2: Redis cluster health check doesn't check cancellation early

The Redis cluster health check didn't check context cancellation before attempting the Redis connection, wasting resources during shutdown.

Solution

  • Fix1: Use passed context in Redis v3 health check
  • Fix2: Add early context cancellation check in Redis cluster

cre8ivejp and others added 24 commits October 9, 2025 10:31
…fic spikes

Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
Signed-off-by: Alessandro Yuichi Okimoto <yuichijpn@gmail.com>
@nnnkkk7
Copy link
Contributor Author

nnnkkk7 commented Oct 16, 2025

This change might improve the result...🤔
#2155

@cre8ivejp cre8ivejp force-pushed the fix-gracefull-shutdown branch 5 times, most recently from d9d3775 to 534fa52 Compare October 18, 2025 09:26
@cre8ivejp cre8ivejp force-pushed the fix-gracefull-shutdown branch 4 times, most recently from 41961ae to f6d8894 Compare October 18, 2025 12:14
Base automatically changed from fix-gracefull-shutdown to main October 20, 2025 14:22
@nnnkkk7 nnnkkk7 closed this Oct 22, 2025
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.

3 participants