mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-25 23:15:51 +03:00
[GH-ISSUE #808] [FEATURE REQUEST] [BUG] PostEnqueueFunc -> When Error occur, info is nil and we dont have way to access task #2424
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#2424
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 @abhi9720 on GitHub (Jan 27, 2024).
Original GitHub issue: https://github.com/hibiken/asynq/issues/808
Originally assigned to: @hibiken on GitHub.
Is your feature request related to a problem? Please describe.
I have created a new periodic task manager and registered a post-enqueue function with it. However, due to some issue such as a task ID conflict, an error occurred and the taskinfo became nil. Now, how to access the task in the post method to determine which task caused the error.
Describe the solution you'd like
Describe alternatives you've considered
Additional context
@kamikazechaser commented on GitHub (Jan 28, 2024):
Are you talking about an error which is encountered in a task handler?
You can use a
asynq.MiddlewareFuncwhich returns anasynq.Handler. In that you canProcessTaskand see if any error or panic occurs and dump the task id, payload e.t.c.@abhi9720 commented on GitHub (Jan 28, 2024):
@kamikazechaser
I am talking about PostEnqueueFunc, when taskId conflict happens, I get an error of task id conflict, but I have no info about which task is in the post-enqueue function.
@kamikazechaser commented on GitHub (Jan 29, 2024):
That is intended behavior, whenever an error occurs anywhere in the "Run" chain a nil value is returned in place of the return type (a pointer), in this case it happens in the Enqueue method. I personally don't see this as a bug but you definitely have less info to work with in the event of an error.
It could make sense to enrich the error messages in the Enqueue method instead. Would that suffice?
@abhi9720 commented on GitHub (Jan 29, 2024):
@kamikazechaser, ya something like that which help us to get access to error of that task.