Skip to content

feat(runners): add runner_id to db for task#3712

Merged
fiftin merged 1 commit into2-17-stablefrom
fix/task_runner_id
Mar 22, 2026
Merged

feat(runners): add runner_id to db for task#3712
fiftin merged 1 commit into2-17-stablefrom
fix/task_runner_id

Conversation

@fiftin
Copy link
Copy Markdown
Collaborator

@fiftin fiftin commented Mar 22, 2026

No description provided.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f31f8fb142

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 262 to +264
if tsk == nil {
continue
var err error
tsk, err = taskPool.HydrateTaskRunnerFromDB(job.ID)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject runner updates for tasks that already left the pool

When a remote task finishes it is removed from TaskPool, so this new HydrateTaskRunnerFromDB fallback also rehydrates already-finished tasks from the database. In that case TaskRunner.SetStatus in services/tasks/TaskRunner_logging.go returns immediately for success/fail/stopped, but this handler still executes LogWithTime and SetCommit, so any delayed or retried runner PUT can append output or overwrite commit metadata on a completed task. This shows up in HA/load-balanced setups where the last progress request lands after the owning node has already stopped tracking the task.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex fix it

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Testing

  • gofmt -w api/runners/runners.go api/runners/runners_test.go
  • git commit -m "fix(runners): ignore late updates for finished tasks"
  • go test ./pkg/task_logger -run TestDoesNotExist -count=1
  • ⚠️ timeout 30s go test ./api/runners -run '^$' -count=1 -timeout 20s; echo EXIT:$? — timed out in this environment with EXIT:124.
  • ⚠️ timeout 30s go test ./api/runners -run TestUpdateRunnerIgnoresFinishedTaskUpdates -count=1; echo EXIT:$? — timed out in this environment with EXIT:124.

View task →

@fiftin fiftin merged commit 8027047 into 2-17-stable Mar 22, 2026
1 of 2 checks passed
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.

1 participant