@actions/artifact: recognized network errors bypass the configured Twirp retry budget and lose their cause
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- node.js, typescript
- 領域
- api, networking
調査の方向性
Start in the artifact Twirp client's ArtifactHttpClient.retryableRequest catch block, where ECONNRESET, ENOTFOUND, ETIMEDOUT, ECONNREFUSED and EHOSTUNREACH currently throw NetworkError immediately, and check how the outer request wrapper drops the code and cause. Run the issue's mocked HttpClient.prototype.post script to confirm one call instead of the expected retries. Done means transient codes retry within maxAttempts with the structured code and cause kept, while 4xx and quota errors still fail at once; the lost-finalize-response policy is a separate design question.
索引モデルが issue の本文から書いたものです。
説明
While checking the latest @actions/[email protected] on Node 26.13.1, I reproduced a recognized transient network error bypassing the configured Twirp retry budget. I searched existing network/retry/FinalizeArtifact reports, including #2575 (a different download-response cleanup bug), and found no report for this branch.
In ArtifactHttpClient.retryableRequest, the catch block immediately throws new NetworkError(error.code) for ECONNRESET, ENOTFOUND, ETIMEDOUT, ECONNREFUSED and EHOSTUNREACH. Therefore maxAttempts: 3 does not retry even one simulated ECONNRESET followed by success. The outer request wrapper then discards the structured code/cause, making callers parse the error message to recognize the transient failure.
Reproduce without any real network access, credentials or waiting after installing @actions/[email protected] and @actions/[email protected]:
import assert from 'node:assert/strict';
import { HttpClient } from '@actions/http-client';
// Relative path is intentional: this is a diagnostic of the published internal transport.
import { internalArtifactTwirpClient } from './node_modules/@actions/artifact/lib/internal/shared/artifact-twirp-client.js';
process.env.ACTIONS_RUNTIME_TOKEN = 'example-runtime-token';
process.env.ACTIONS_RESULTS_URL = 'https://example.invalid';
let calls = 0;
HttpClient.prototype.post = async () => {
calls++;
if (calls === 1) throw Object.assign(new Error('mock reset'), { code: 'ECONNRESET' });
return { message: { statusCode: 200, headers: {} }, readBody: async () => JSON.stringify({ ok: true }) };
};
const client = internalArtifactTwirpClient({ maxAttempts: 3, retryIntervalMs: 1 });
await assert.rejects(client.CreateArtifact({ workflowRunBackendId: '1', workflowJobRunBackendId: '2', name: 'evidence', version: 7 }), /ECONNRESET/);
assert.equal(calls, 1);
Could retryable network failures participate in the existing bounded policy, with structured code/cause retained? Keep permanent 4xx and quota errors immediate. For state-changing calls, please also document/support safe lost-response handling: a finalized upload may exist when its response was lost, so blindly restarting the entire upload can cause an existing-name conflict. An SDK-supported operation-level policy would let consumers avoid duplicating that recovery logic.
Our retained consumer workaround in https://github.com/link-foundation/python-ai-driven-development-pipeline-template/pull/152 bounds retries at the artifact transport boundary, without repeating the test/build producer. Names must be unique per producer; it rejects artifacts present before the first attempt, and only reconciles/replaces that producer's unique name on a retry. Existing mocked tests cover transient codes, permanent failures, bounded exhaustion, lost finalize responses, preexisting-artifact refusal, download digest validation and strict extraction. The checked-in experiment additionally exercises this actual published SDK branch, rather than only a mock of our own adapter.
- 主要言語
- TypeScript
- スター
- 5.9k
- フォーク
- 1.8k
- 平均マージ
- 15分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
actions/toolkit のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
@actions/io: `mv(file, dest)` replaces `dest` when it is a symlink to a directory instead of moving into it対応中かも @bardrop が 7 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
@actions/exec: `exec(commandLine)` drops `""` arguments and trims trailing spaces of the last argument対応中かも @bardrop が 7 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
actions/toolkit#2565 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
actions/toolkit の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 87/100
メンテナーはふだん 1 日以内に返信
-
🛠️ dette technique
難易度 2/5 1〜3時間 初心者へのやさしさ 61/100
betagouv/mon-entreprise#4752 · コメント 1 件 ·
メンテナーはふだん 5 日以内に返信
-
type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
franciscoBSalgueiro/en-croissant#1111 ·
メンテナーはふだん 2 日以内に返信
-
area/providers type/feature version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
anomalyco/opencode#64845 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信