new Reaper({ storage, name }) fails to start because its namespace is never connected
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- postgresql, redis, typescript
調査の方向性
Start with src/reaper.ts, especially the constructor and start()/stop() lifecycle, then compare it with Queue.start(), which connects its created namespace. Verify the named Reaper path for both RedisStorage and PgStorage, including cleanup after a failed start; done means start succeeds and stop disconnects the internally created namespace.
索引モデルが issue の本文から書いたものです。
説明
new Reaper({ storage, name }) creates a namespace from storage but never connects it, so start() fails on the first storage call. Named queues can't be paired with a Reaper unless you connect the namespace yourself and pass it without name.
Reproduction
@platformatic/[email protected] (also on main), with Redis on localhost:
import { RedisStorage, Reaper } from '@platformatic/job-queue'
const storage = new RedisStorage({ url: 'redis://localhost:6379' })
await storage.connect()
const reaper = new Reaper({ storage, name: 'emails' })
try {
await reaper.start()
console.log('started')
} catch (err) {
console.log('reaper.start() failed:', err.message)
} finally {
await reaper.stop()
await storage.disconnect()
}
Output:
reaper.start() failed: Cannot read properties of null (reading 'subscribe')
With PgStorage, subscribing succeeds and start() then fails in getWorkers() with Cannot read properties of null (reading 'query').
Cause
The constructor does config.storage.createNamespace(config.name) (reaper.ts#L66), but neither start() nor stop() connects or disconnects that namespace. Queue also creates its namespace in the constructor, but calls storage.connect() in start(). No test currently uses a named Reaper.
Suggested fix
When the Reaper created the namespace itself, connect it at the start of start() (before subscribing or leader election) and disconnect it in stop(). If start() fails, clean up and reset the running flag so it can be retried.
I'm happy to send a PR for this.
- 主要言語
- TypeScript
- スター
- 371
- フォーク
- 11
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
platformatic/job-queue のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
platformatic/job-queue#54 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
platformatic/job-queue#53 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
platformatic/job-queue#51 ·
platformatic/job-queue の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
VictoriaMetrics/victorialogs-datasource#747 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
bug from-studio
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
esengine/DeepSeek-Reasonix#14608 ·
メンテナーはふだん 1 日以内に返信
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
getarcaneapp/arcane#4590 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
Clouditera/VulnHunter#57 ·