mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-25 23:15:51 +03:00
[GH-ISSUE #975] [BUG] RedisClient created by PeriodicTaskManager doesn't close connection #2496
Labels
No labels
CLI
bug
designing
documentation
duplicate
enhancement
good first issue
good first issue
help wanted
idea
invalid
investigate
needs-more-info
performance
pr-welcome
pull-request
question
wontfix
work in progress
work in progress
work-around-available
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/asynq#2496
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @HuangShaoyan on GitHub (Nov 27, 2024).
Original GitHub issue: https://github.com/hibiken/asynq/issues/975
Originally assigned to: @hibiken, @kamikazechaser on GitHub.
Describe the bug
asynq creates a scheduler using
NewSchedulerwhen invokingNewPeriodicTaskManager, settingscheduler.sharedConnectionto false. However,scheduler.client.sharedConnectionremains true.It will cause
Client.Closeto printredis connection is shared so the Client can't be closed through asynq.Environment:
asynqv0.25.0To Reproduce
asynq.NewPeriodicTaskManager.Expected behavior
asynq should set
scheduler.client.sharedConnectiontofalsewhen the Redis client is created by the PeriodicTaskManager itself.@kamikazechaser commented on GitHub (Dec 3, 2024):
Probably landed in #958. Pinging @daixijun as well.Actually landed in #742. I'll review the entire PR again.
@kamikazechaser commented on GitHub (Dec 3, 2024):
I can reproduce it:
@kamikazechaser commented on GitHub (Dec 3, 2024):
@HuangShaoyan I have pushed a fix pending review. Could you try it out? https://github.com/hibiken/asynq/tree/sohail/pm-redis-conn-hotfix
go get github.com/hibiken/asynq@f1e7dc4056abaa6549bf014d2e6b67508437d236@HuangShaoyan commented on GitHub (Dec 3, 2024):
I have tested the fix
f1e7dc, and I can confirm that the bug has been resolved.