-
-
Notifications
You must be signed in to change notification settings - Fork 701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Use a custom redis client that will panic if redis close #635
Comments
@shuqingzai My guess would be the msg is nil. And this is related to to the pubsub returned by your custom redis's Subscribe. Since I have no idea which lib you are using, you probably need to check your lib's implementation. |
@bfwbbrj First of all, thank you for answering my question
|
The redis client implementation that you are using.
It should be related to the Subscribe method of your redis client implementation. Can you share which redis client implementation you are using? |
Observe my screenshot, using go-redis's built-in interface analysis See: https://github.com/redis/go-redis/blob/v8/universal.go#L208 |
所以你的 |
|
Is it possible for you not to close the Redis client and leave the work to asynq? Currently if you closed the redis client before you shutdown the asynq, msg will be nil since the channel is already closed. I will create a pr to fix this but since rn prs are not being reviewed and merge. I suggest that you let asynq do the client closing if possible. |
Describe the bug
If you implement the
asynq.RedisConnOpt
interface and provide a custom redis client,Ctrl + C
stops theasynq.Server
andasynq.Subscriber
panicsTo Reproduce
Steps to reproduce the behavior (Code snippets if applicable):
asynq.RedisConnOpt
interface and provide a custom redis clientasynq.Server
and set up a custom redis clientasynq.RedisConnOpt
return nilasynq.Subscriber
panicsExpected behavior
Can support custom providing redis client instead of panic
Because asynq will start multiple redis clients, and redis will also be used in my project, I hope that only one redis client can be instantiated for unified management and reuse clients
Screenshots
If applicable, add screenshots to help explain your problem.
stop custom redis client will return nil
asynq.Subscriber
panicsBecause
my redis client
returns nil ??Environment (please complete the following information):
asynq
package [e.g. v1.0.0]Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: