fix(backend): クラスタ有効時にonlyQueueモードでジョブキューが二重起動する問題を修正#17295
fix(backend): クラスタ有効時にonlyQueueモードでジョブキューが二重起動する問題を修正#17295kakkokari-gtyih wants to merge 2 commits intomisskey-dev:developfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #17295 +/- ##
===========================================
- Coverage 63.79% 63.67% -0.13%
===========================================
Files 1162 1162
Lines 116401 116402 +1
Branches 8455 8414 -41
===========================================
- Hits 74261 74115 -146
- Misses 39941 40088 +147
Partials 2199 2199 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
このPRによるapi.jsonの差分 |
Backend memory usage comparisonBefore GC
After GC
After Request
|
There was a problem hiding this comment.
Pull request overview
クラスタ有効時(disableClustering が false)に onlyQueue モードで起動するとジョブキューが親プロセス・子プロセスの両方で起動してしまう問題を防ぎ、キュー処理の二重起動を解消するPRです。
Changes:
- クラスタ有効時の
onlyQueueモードで、マスタープロセス側のjobQueue()起動を抑止 - CHANGELOG に修正内容を追記
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/backend/src/boot/master.ts | クラスタ有効時の onlyQueue 分岐でマスターが jobQueue() を起動しないように変更 |
| CHANGELOG.md | 上記修正の告知を追記 |
| } else if (envOption.onlyQueue) { | ||
| await jobQueue(); | ||
| // onlyQueue かつ enableCluster な場合も、メインプロセスはforkのみに制限する。 | ||
| // ワーカープロセス側でjobQueueを起動するため、ここで起動すると親子でキュー処理が二重起動する。 | ||
| } else { |
There was a problem hiding this comment.
With clustering enabled and onlyQueue mode, the master no longer starts jobQueue() (intended), so the queue will only start in forked workers. However, if config.clusterLimit is explicitly set to 0, spawnWorkers(0) will spawn zero workers and the queue will never start (previously the master started it even when worker count was 0). Consider enforcing clusterLimit >= 1 (or falling back to 1) in this branch, or explicitly erroring on clusterLimit <= 0 when clustering is enabled.
|
たぶんこれではなおらない |
What
Why
#17292 がなおるかもしれない
Additional info (optional)
Checklist