[PR #977] [MERGED] fix: NewScheduler incorrectly creates underlying Client, closing broker properly #2977

Closed
opened 2026-03-15 21:13:39 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hibiken/asynq/pull/977
Author: @kamikazechaser
Created: 12/4/2024
Status: Merged
Merged: 12/6/2024
Merged by: @kamikazechaser

Base: masterHead: sohail/pm-redis-conn-hotfix


📝 Commits (2)

  • ee17997 fix: NewScheduler wrongly creates a client whose sharedConnection value is always true
  • f1e7dc4 fix: closing the Client also closes the broker

📊 Changes

1 file changed (+17 additions, -10 deletions)

View changed files

📝 scheduler.go (+17 -10)

📄 Description

  • closes: #975

  • fix: NewScheduler wrongly creates a client whose sharedConnection value is always true: This is affecting the PeriodicManager as well as the Scheduler

  • fix: closing the Client also closes the broker: The error was also previously unhandled. For shared connections an error will be returned by the broker itself because the sharedConnection bool is also set on the client. This also means we can get rid of the sharedConnection flag on the Scheduler itself and let it work internally


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hibiken/asynq/pull/977 **Author:** [@kamikazechaser](https://github.com/kamikazechaser) **Created:** 12/4/2024 **Status:** ✅ Merged **Merged:** 12/6/2024 **Merged by:** [@kamikazechaser](https://github.com/kamikazechaser) **Base:** `master` ← **Head:** `sohail/pm-redis-conn-hotfix` --- ### 📝 Commits (2) - [`ee17997`](https://github.com/hibiken/asynq/commit/ee17997650f36a16d5b7583b20deb6c5571bbef4) fix: NewScheduler wrongly creates a client whose sharedConnection value is always true - [`f1e7dc4`](https://github.com/hibiken/asynq/commit/f1e7dc4056abaa6549bf014d2e6b67508437d236) fix: closing the Client also closes the broker ### 📊 Changes **1 file changed** (+17 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `scheduler.go` (+17 -10) </details> ### 📄 Description * closes: #975 * fix: NewScheduler wrongly creates a client whose sharedConnection value is always true: This is affecting the PeriodicManager as well as the Scheduler * fix: closing the Client also closes the broker: The error was also previously unhandled. For shared connections an error will be returned by the broker itself because the sharedConnection bool is also set on the client. This also means we can get rid of the sharedConnection flag on the Scheduler itself and let it work internally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-15 21:13:39 +03:00
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#2977
No description provided.