Skip to content

fix(linter): cap checker pool and workers to 4, add panic recovery per-file#1019

Open
armandthuillart wants to merge 1 commit into
oxc-project:mainfrom
armandthuillart:main
Open

fix(linter): cap checker pool and workers to 4, add panic recovery per-file#1019
armandthuillart wants to merge 1 commit into
oxc-project:mainfrom
armandthuillart:main

Conversation

@armandthuillart

@armandthuillart armandthuillart commented Jun 19, 2026

Copy link
Copy Markdown

Patch 0001 set the checker pool size to runtime.GOMAXPROCS(0), creating excessive concurrent goroutines with deep TypeScript type-checking stacks. The Go GC stack walker can get stuck scanning these stacks, pinning a core at 100% CPU. This makes my laptop heat up significantly.

It caps the checker pool to min(4, runtime.GOMAXPROCS(0)) and also the linter workers to min(options.Workers, 4). Then it wraps per-file processing in defer/recover so a rule panic doesn't abort the entire lint run.

Related: oxc-project/oxc#23618

…r-file

Cap checker pool and file-processing workers to 4 (min of configured
value and runtime.GOMAXPROCS(0)). This prevents excessive goroutine
count and reduces GC stack scanner pressure during concurrent
TypeScript type checking, which was observed causing a stuck
runtime.(*unwinder).next spinning at 100% CPU.

Wrap per-file processing in the linter with a deferred panic recovery
that logs the file name and rule name, then clears listener state so
a panic in one file does not crash the entire lint run.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant