[PR #1058] fix: add sleep to avoid high CPU usage when Redis is unreachable in D… #3017

Open
opened 2026-03-15 21:15:43 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hibiken/asynq/pull/1058
Author: @zhongyuanjia
Created: 6/23/2025
Status: 🔄 Open

Base: masterHead: master


📝 Commits (1)

  • bfe15db fix: add sleep to avoid high CPU usage when Redis is unreachable in Dequeue

📊 Changes

1 file changed (+7 additions, -0 deletions)

View changed files

📝 processor.go (+7 -0)

📄 Description

When the project fails to connect to Redis, the Dequeue method is called in a tight loop without any delay. This causes the container's CPU usage to spike, as the processor keeps retrying immediately after each failure.


🔄 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/1058 **Author:** [@zhongyuanjia](https://github.com/zhongyuanjia) **Created:** 6/23/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`bfe15db`](https://github.com/hibiken/asynq/commit/bfe15db28925bc16aa459a9e7b8baaf2c3baa194) fix: add sleep to avoid high CPU usage when Redis is unreachable in Dequeue ### 📊 Changes **1 file changed** (+7 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `processor.go` (+7 -0) </details> ### 📄 Description When the project fails to connect to Redis, the Dequeue method is called in a tight loop without any delay. This causes the container's CPU usage to spike, as the processor keeps retrying immediately after each failure. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#3017
No description provided.