Skip to content

fix: normalize nil context in UpdateTask - #104

Merged
Bury-Lee merged 1 commit into
Yiming1997:mainfrom
1m55555555:fix/update-task-nil-context
Sep 15, 2026
Merged

Bury-Lee merged 1 commit into
Yiming1997:mainfrom
1m55555555:fix/update-task-nil-context

Conversation

@1m55555555

Copy link
Copy Markdown
Contributor

Summary

  • Normalize a nil context passed to UpdateTask to context.Background().
  • Add a regression test ensuring Submit(UpdateTask(nil, task)) executes the task.

Problem

SubmitCtx(nil, task) already treats a nil context as context.Background(). However, UpdateTask(nil, task) created a wrapped task with a nil context.

When a worker processed that task, evaluating ctx.Err() panicked. The worker recovered the panic, but the submitted task was skipped.

Fix

Normalize nil contexts inside UpdateTask, matching the existing SubmitCtx behavior.

Validation

  • go test . -count=1
  • go test -short ./... -count=1
  • go test -race . -run '^TestAgilePoolUpdateTaskNilContextRunsTask$' -count=1
  • go vet ./...

Scope

No changes to hooks, scheduling, buffering, scaling, or public API shape.

@Yiming1997

Copy link
Copy Markdown
Owner

@Bury-Lee pls check

@Bury-Lee
Bury-Lee merged commit 37cea2f into Yiming1997:main Sep 15, 2026
1 check passed
@Bury-Lee

Copy link
Copy Markdown
Collaborator

@Bury-Lee pls check

OK

@1m55555555
1m55555555 deleted the fix/update-task-nil-context branch September 15, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants