Repository navigation
fix(runner): retry transient task completion report failures - #945
Open
rudycelekli wants to merge 1 commit into
Open
rudycelekli wants to merge 1 commit into
rudycelekli wants to merge 1 commit into
Conversation
Yanami-2K
approved these changes
Nov 16, 2026
Yanami-2K
left a comment
Collaborator
There was a problem hiding this comment.
核对了 internal/runner/client.go:do 把非 2xx 响应包成 runnerResponseError(错误文案与原来一致),Complete 只对传输层 *url.Error 和 5xx 重试,最多 3 次,每次退避前都会检查 ctx;409 租约丢失和其他 4xx 不重试,重试的只是上报请求,不会重新执行任务。测试覆盖了“503 后重试成功并断言请求次数为 2”和“租约丢失只发一次”两种情况。配合 #937(数据库故障返回 5xx 而不是 409),瞬时故障时完成结果可以正常落库。它和 #944 都改了同一个文件,但改的是不同的函数。本 PR 只跑了开源扫描,合入前请触发 platform CI。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
A runner submits the terminal result only once. If that request hits a temporary server or network failure, it stops reporting even though the task may have completed and its lease is still valid.
Retry the same report up to two more times within the caller's deadline. A lost lease or a rejected request stops the retry. The runner does not repeat the executed task. If a report already committed, the existing server ownership check rejects further writes.
Validation
An HTTP fixture accepts the same result after an initial 503. Base submitted once and returned the error. The fix reports successfully on the second attempt, and a lost-lease response still sends only once. Focused completion, client and daemon tests, public-content checks and diff checks passed. No live execution machine was used.