Job cancellation doesn't work in database/sql driver
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
調査の方向性
Reproduce the issue with the SortWorker example, riverui's Cancel action, and riverdatabasesql.New using the described pgx and ocsql setup. Start by tracing cancellation from the cancel_attempted_at metadata to the Work context; done means the worker observes ctx.Done, logs CANCELLED, and stops before the 20-second delay.
索引モデルが issue の本文から書いたものです。
説明
Hi!
I am using the example SortWorker job with small adjustments to test longer-running jobs with cancellation but it does not seem to work.
const SortJobKind = "sort"
type SortArgs struct {
Strings []string `json:"strings"`
}
func (SortArgs) Kind() string {
return SortJobKind
}
type SortWorker struct {
river.WorkerDefaults[SortArgs]
}
func (w *SortWorker) Work(ctx context.Context, job *river.Job[SortArgs]) error {
log.Printf("STARTING: %d", job.ID)
select {
case <-ctx.Done():
log.Printf("CANCELLED: %d", job.ID)
return ctx.Err()
case <-time.After(20 * time.Second):
log.Printf("WILL DO: %d", job.ID)
}
items := job.Args.Strings
sort.Strings(items)
log.Printf("RESULT: %+v\n", items)
return nil
}
When the job appears in the User Interface (riverui), I click Cancel but the job keeps running. In the logs I eventually get from STARTING to WILL DO but never observe CANCELLED.
The only thing that indicates some attempt at cancellation is the metadata field on the job which states:
{
"cancel_attempted_at": "2024-10-02T....."
}
Am I doing something wrong or is there a potential bug?
I am running v0.12.1 and using riverdatabasesql.New, though the underlying connection is pgx, wrapped with opencensus tracing (ocsql).
- 主要言語
- Go
- スター
- 6k
- フォーク
- 210
- 平均マージ
- 12時間 2分
- マージ済み PR(30日)
- 24
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
riverqueue/river のほかの issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
riverqueue/river#1608 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
riverqueue/river#1599 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
riverqueue/river#1258 · コメント 7 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
riverqueue/river#1225 · コメント 14 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
riverqueue/river#1185 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
riverqueue/river の issue をすべて見る
似ている issue
-
ConcatAgenticMessages loses the approval request ID of a streamed MCP tool call対応中かも @ningsiyuan1024 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
containers/gvisor-tap-vsock#796 ·
メンテナーはふだん 2 日以内に返信
-
external needs:triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
celestiaorg/celestia-node#5448 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: Azure SAS signing uses local time instead of UTC, shifting validity window on non-UTC hosts対応中かも @huanghaoyuanhhy が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
zilliztech/milvus-backup#1418 ·
メンテナーはふだん 1 日以内に返信