-
-
Notifications
You must be signed in to change notification settings - Fork 722
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] RedisClient created by PeriodicTaskManager doesn't close connection #975
Labels
bug
Something isn't working
Comments
I can reproduce it: asynq: pid=20593 2024/12/03 05:57:22.303908 INFO: Scheduler starting
asynq: pid=20593 2024/12/03 05:57:22.303939 INFO: Scheduler timezone is set to UTC
asynq: pid=20593 2024/12/03 05:57:22.303945 INFO: Send signal TERM or INT to stop the scheduler
^Casynq: pid=20593 2024/12/03 05:57:22.781738 INFO: Scheduler shutting down
asynq: pid=20593 2024/12/03 05:57:22.783083 ERROR: Failed to close redis client connection: redis connection is shared so the Client can't be closed through asynq
asynq: pid=20593 2024/12/03 05:57:22.783122 INFO: Scheduler stopped
2024/12/03 08:57:42 graceful shutdown period exceeded, forcefully shutting down
exit status 1 |
@HuangShaoyan I have pushed a fix pending review. Could you try it out? https://github.com/hibiken/asynq/tree/sohail/pm-redis-conn-hotfix
|
I have tested the fix |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
asynq creates a scheduler using
NewScheduler
when invokingNewPeriodicTaskManager
, settingscheduler.sharedConnection
to false. However,scheduler.client.sharedConnection
remains true.It will cause
Client.Close
to printredis connection is shared so the Client can't be closed through asynq
.Environment:
asynq
v0.25.0To Reproduce
asynq.NewPeriodicTaskManager
.Expected behavior
asynq should set
scheduler.client.sharedConnection
tofalse
when the Redis client is created by the PeriodicTaskManager itself.The text was updated successfully, but these errors were encountered: