{"record":{"id":"d5f2f449734807a3","repo":"ruvnet/ruflo","slug":"maximum-worker-limit-this-config-maxworkers-r","errorCode":null,"errorMessage":"Maximum worker limit (${this.config.maxWorkers}) reached","messagePattern":"Maximum worker limit \\((.+?)\\) reached","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/plugins/src/workers/index.ts","lineNumber":365,"sourceCode":"      avgTaskDuration: 0,\n    };\n  }\n\n  private startHealthChecks(): void {\n    this.healthCheckTimer = setInterval(\n      () => this.performHealthChecks(),\n      this.config.healthCheckInterval\n    );\n  }\n\n  private async performHealthChecks(): Promise<void> {\n    const results = await this.healthCheck();\n    this.emit(WORKER_EVENTS.HEALTH_CHECK, { results: Object.fromEntries(results) });\n  }\n\n  async spawn(definition: WorkerDefinition): Promise<IWorkerInstance> {\n    if (this._workers.size >= this.config.maxWorkers) {\n      throw new Error(`Maximum worker limit (${this.config.maxWorkers}) reached`);\n    }\n\n    const workerId = `worker-${this.nextWorkerId++}`;\n    const worker = new WorkerInstance(workerId, definition);\n\n    this._workers.set(workerId, worker);\n    this.poolMetrics.totalWorkers++;\n    this.poolMetrics.idleWorkers++;\n\n    this.emit(WORKER_EVENTS.SPAWNED, { workerId, definition });\n\n    return worker;\n  }\n\n  async terminate(workerId: string): Promise<void> {\n    const worker = this._workers.get(workerId);\n    if (!worker) {\n      throw new Error(`Worker ${workerId} not found`);","sourceCodeStart":347,"sourceCodeEnd":383,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/plugins/src/workers/index.ts#L347-L383","documentation":"WorkerPool.spawn hit the configured maxWorkers ceiling: the pool already holds maxWorkers worker instances. This is a capacity guard protecting the host from unbounded worker creation; spawning more requires terminating an existing worker first.","triggerScenarios":"A new worker is requested when the pool already has config.maxWorkers workers.","commonSituations":"Burst of concurrent tasks, leaked workers never released, or maxWorkers set too low.","solutions":["Release/terminate idle workers before spawning new ones.","Increase maxWorkers to match expected concurrency.","Queue work and reuse existing workers instead of spawning per task."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}