[PR #926] [MERGED] Call all context cancelFunc in processor.go #920

Closed
opened 2026-03-02 06:10:26 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hibiken/asynq/pull/926
Author: @pior
Created: 10/25/2024
Status: Merged
Merged: 10/26/2024
Merged by: @kamikazechaser

Base: masterHead: cancel-context


📝 Commits (1)

  • 96c3117 Call all context cancelFunc in processor

📊 Changes

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

View changed files

📝 processor.go (+10 -5)

📄 Description

Context

Similar change as https://github.com/hibiken/asynq/pull/145

We are potentially leaking context goroutines in requeue(), markAsComplete(), markAsDone(), retry(), archive() methods.

Those methods are not doing anything weird with the context, they are simply calling r.runScript(ctx, ...), we can safely cancel this context as usual.

Changes

  • Add defer cancel()

🔄 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/926 **Author:** [@pior](https://github.com/pior) **Created:** 10/25/2024 **Status:** ✅ Merged **Merged:** 10/26/2024 **Merged by:** [@kamikazechaser](https://github.com/kamikazechaser) **Base:** `master` ← **Head:** `cancel-context` --- ### 📝 Commits (1) - [`96c3117`](https://github.com/hibiken/asynq/commit/96c3117cf318e5b8c10ef79972a37643181722ac) Call all context cancelFunc in processor ### 📊 Changes **1 file changed** (+10 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `processor.go` (+10 -5) </details> ### 📄 Description ## Context Similar change as https://github.com/hibiken/asynq/pull/145 We are potentially leaking context goroutines in requeue(), markAsComplete(), markAsDone(), retry(), archive() methods. Those methods are not doing anything weird with the context, they are simply calling `r.runScript(ctx, ...)`, we can safely cancel this context as usual. ## Changes - Add `defer cancel()` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 06:10:26 +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#920
No description provided.