Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

new Reaper({ storage, name }) fails to start because its namespace is never connected

オープン
#52 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
postgresql, redis, typescript
領域
backend, databases

調査の方向性

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 ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

platformatic/job-queue のほかの issue

platformatic/job-queue の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。