Skip to content

Stop growing the pool when thread creation fails - #80

Open
mikamikasuki wants to merge 1 commit into
smol-rs:masterfrom
mikamikasuki:fix/spawn-failure-livelock
Open

mikamikasuki wants to merge 1 commit into
smol-rs:masterfrom
mikamikasuki:fix/spawn-failure-livelock

Conversation

@mikamikasuki

Copy link
Copy Markdown

A failed thread spawn restores the pool counters but leaves the loop testing a cached thread limit. Persistent spawn failures therefore spin while holding the executor mutex, preventing existing workers from draining the queue.

Stop pool growth after the failed spawn and limit update. This releases the mutex; it does not guarantee task execution when no worker can be created. The native regression forces thread creation to fail in an isolated child: it times out before the fix and exits successfully afterward.

Existing tests, 13 doctests, strict clippy, formatting, and the WASM all-target check pass.

Fixes #79.

Prepared with AI assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Executor::grow_pool livelocks at 100 % CPU when thread::Builder::spawn fails persistently

1 participant