worker: the scheduler double-emits every recurring job if outpost-worker scales past 1
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 38/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- typescript
調査の方向性
packages/outpost/queue/src/scheduler.ts:79 と apps/worker/src/index.ts:94,117 から始めて、scheduler の構築と起動を追跡します。関連する調整のコンテキストについて、SystemConfig テーブルと既存の issue #133 を調べます。完了条件は、outpost-worker が 1 つを超えるレプリカにスケールされた場合でも、重複した enqueue なしに、定期ジョブが 1 つの worker レプリカだけから発行されることです。
索引モデルが issue の本文から書いたものです。
説明
packages/outpost/queue/src/scheduler.ts:79 schedules recurring jobs with a plain in-process interval:
const timer = setInterval(() => this.tick(definition), definition.intervalMs);
apps/worker/src/index.ts:94 constructs one Scheduler per process and starts it at :117. With a single outpost-worker replica this is correct. At two replicas, both tick, and every scheduled job type — SLA_CHECK, ONBOARDING_DIGEST, GITHUB_REACTION_POLL, ACCOUNT_SCORING, JOB_CLEANUP — is enqueued twice per interval.
Why it matters
It is a scaling landmine rather than a live defect: nothing warns you, and the first symptom would be duplicate outbound posts from the digest, which is exactly the class of bug #133 was filed to prevent.
Fix
Leader election on the SystemConfig table — a lease row the scheduler must hold, renewed each tick, so exactly one replica emits. Alternatively, split the scheduler into its own single-replica service. Either way, worth landing before anyone scales the worker, not after.
- 主要言語
- TypeScript
- スター
- 12
- フォーク
- 6
- 平均マージ
- 2時間 23分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CopilotKit/outpost のほかの issue
-
area: docs area: security roadmap: now
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
CopilotKit/outpost#277 ·
メンテナーはふだん 1 日以内に返信
-
area: infrastructure roadmap roadmap: later
難易度 1/5 1時間未満 初心者へのやさしさ 74/100
CopilotKit/outpost#179 ·
メンテナーはふだん 1 日以内に返信
-
area: ai roadmap roadmap: now
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
CopilotKit/outpost#145 ·
メンテナーはふだん 1 日以内に返信
-
area: integrations priority: low roadmap roadmap: later
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
CopilotKit/outpost#124 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
area: integrations priority: low roadmap roadmap: later
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
CopilotKit/outpost#123 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
CopilotKit/outpost の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
juice-shop/juice-shop#3686 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
dsh-market/dsh-market#877 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
ScottKirvan/GOMAC#61 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
stellar/stellar-dev-skill#151 ·
メンテナーはふだん 1 日以内に返信