Skip to content

fix(runner): retry transient task completion report failures - #945

Open
rudycelekli wants to merge 1 commit into
Tencent:mainfrom
rudycelekli:fix/platform-retry-runner-completion
Open

rudycelekli wants to merge 1 commit into
Tencent:mainfrom
rudycelekli:fix/platform-retry-runner-completion

Conversation

@rudycelekli

Copy link
Copy Markdown

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.

@Yanami-2K Yanami-2K left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

核对了 internal/runner/client.go:do 把非 2xx 响应包成 runnerResponseError(错误文案与原来一致),Complete 只对传输层 *url.Error 和 5xx 重试,最多 3 次,每次退避前都会检查 ctx;409 租约丢失和其他 4xx 不重试,重试的只是上报请求,不会重新执行任务。测试覆盖了“503 后重试成功并断言请求次数为 2”和“租约丢失只发一次”两种情况。配合 #937(数据库故障返回 5xx 而不是 409),瞬时故障时完成结果可以正常落库。它和 #944 都改了同一个文件,但改的是不同的函数。本 PR 只跑了开源扫描,合入前请触发 platform CI。

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.

2 participants