[GH-ISSUE #974] [BUG] register same type task but it excute once ,when try several times it was no excute!! #466

Closed
opened 2026-03-02 05:21:24 +03:00 by kerem · 2 comments
Owner

Originally created by @Godhanhn on GitHub (Nov 22, 2024).
Original GitHub issue: https://github.com/hibiken/asynq/issues/974

Originally assigned to: @hibiken, @kamikazechaser on GitHub.

Describe the bug
register same type task but excute once ,when try several times it was no excute!!

Environment (please complete the following information):

  • OS: [e.g. MacOS, Linux]
  • asynq package version [e.g. v0.24.1]
  • Redis/Valkey version

t.Run("test settle activity task payload", func(t *testing.T) {

	for i := 0; i < 10; i++ {
		RegisterSettleActivityTask(&settle.SettleActivityTaskPayload{
			ActivityId: 1,
			RankId:     1,
			SeasonId:   int32(i),
			ServerId:   1000,
		})
	}

})

func registerSettleActivityTaskImpl(payLoad *settle.SettleActivityTaskPayload) bool {
t1, err := NewSettleActivityTask(payLoad)
if err != nil {
prome.Incr(code.ServiceTaskQueue, fmt.Sprintf("task_create_failed_activity_%d_season_%d_server_%d", payLoad.ActivityId, payLoad.SeasonId, payLoad.ServerId))
logger.BaseWarnLog("could not create task:", err.Error(), payLoad)
return false
}

// 发送奖励
_, err = client.GetClient().Enqueue(t1, asynq.MaxRetry(3))
if err != nil {
	prome.Incr(code.ServiceTaskQueue, fmt.Sprintf("task_enqueue_failed_activity_%d_season_%d_server_%d", payLoad.ActivityId, payLoad.SeasonId, payLoad.ServerId))
	logger.BaseWarnLog("could not enqueue task:", err.Error(), payLoad)
	return false
}

}

Originally created by @Godhanhn on GitHub (Nov 22, 2024). Original GitHub issue: https://github.com/hibiken/asynq/issues/974 Originally assigned to: @hibiken, @kamikazechaser on GitHub. **Describe the bug** register same type task but excute once ,when try several times it was no excute!! **Environment (please complete the following information):** - OS: [e.g. MacOS, Linux] - `asynq` package version [e.g. v0.24.1] - Redis/Valkey version t.Run("test settle activity task payload", func(t *testing.T) { for i := 0; i < 10; i++ { RegisterSettleActivityTask(&settle.SettleActivityTaskPayload{ ActivityId: 1, RankId: 1, SeasonId: int32(i), ServerId: 1000, }) } }) func registerSettleActivityTaskImpl(payLoad *settle.SettleActivityTaskPayload) bool { t1, err := NewSettleActivityTask(payLoad) if err != nil { prome.Incr(code.ServiceTaskQueue, fmt.Sprintf("task_create_failed_activity_%d_season_%d_server_%d", payLoad.ActivityId, payLoad.SeasonId, payLoad.ServerId)) logger.BaseWarnLog("could not create task:", err.Error(), payLoad) return false } // 发送奖励 _, err = client.GetClient().Enqueue(t1, asynq.MaxRetry(3)) if err != nil { prome.Incr(code.ServiceTaskQueue, fmt.Sprintf("task_enqueue_failed_activity_%d_season_%d_server_%d", payLoad.ActivityId, payLoad.SeasonId, payLoad.ServerId)) logger.BaseWarnLog("could not enqueue task:", err.Error(), payLoad) return false } }
kerem 2026-03-02 05:21:24 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@Godhanhn commented on GitHub (Nov 26, 2024):

Logger:

Task Info
ID:
99a9ebbb-cf1a-4e29-868f-3dcd286c37ae

Type:
activity_settle

State:
archived

Queue:
default

Retry:
3/3

Last Failure:
handler not found for task "activity_settle" (2024-11-25T13:33:03Z)

Next Process Time:

Timeout:
1800 seconds

Deadline:

Payload:
{
"activityId": 1,
"rankId": 1,
"gId": 0,
"seasonId": 461,
"serverId": 30001
}

<!-- gh-comment-id:2499408427 --> @Godhanhn commented on GitHub (Nov 26, 2024): Logger: Task Info ID: 99a9ebbb-cf1a-4e29-868f-3dcd286c37ae Type: activity_settle State: archived Queue: default Retry: 3/3 Last Failure: handler not found for task "activity_settle" (2024-11-25T13:33:03Z) Next Process Time: - Timeout: 1800 seconds Deadline: - Payload: { "activityId": 1, "rankId": 1, "gId": 0, "seasonId": 461, "serverId": 30001 }
Author
Owner

@Godhanhn commented on GitHub (Nov 26, 2024):

it was solved! There is another server here that is also consuming, which makes me mistake for thinking that it is not executing it.

<!-- gh-comment-id:2499781544 --> @Godhanhn commented on GitHub (Nov 26, 2024): it was solved! There is another server here that is also consuming, which makes me mistake for thinking that it is not executing it.
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#466
No description provided.