fix(index): prevent stack overflow via async pendingRebuild#100
fix(index): prevent stack overflow via async pendingRebuild#100martinmarsian wants to merge 1 commit into
Conversation
performFullRebuild() called itself synchronously from its own defer block when pendingRebuild was true. Under sustained rebuild pressure (continuous file-system activity keeping pendingRebuild set), this produces 400+ frames of recursive self-invocation and terminates the process with SIGBUS. Use indexQueue.async instead so the next rebuild is scheduled as a new stack frame, not a synchronous recursive call. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Claude finished @nark's task in 1m 15s —— View job Code Review —
|
Summary
performFullRebuild()called itself synchronously from its owndeferblock whenpendingRebuildwas true. Under sustained file-system activity (pendingRebuild staying true across consecutive builds), this produces 400+ frames of recursive self-invocation and terminates the process with SIGBUS.indexQueue.async { [weak self] in self?.performFullRebuild() }so the next rebuild is scheduled as a fresh stack frameFiles changed
Sources/wired3/Controllers/IndexController.swift(1 file, 4 lines)Test plan
🤖 Generated with Claude Code