Skip to content

revolt-rs 0.2.1: fork() from inside a running loop works again; version 0.2.4 - #8

Merged
danog merged 2 commits into
masterfrom
revolt-rs-0.2.1
Nov 26, 2026
Merged

danog merged 2 commits into
masterfrom
revolt-rs-0.2.1

Conversation

@danog

@danog danog commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Updates the embedded revolt-rs from v0.2.0 to v0.2.1 (danog/revolt-rs#4) and bumps the version to 0.2.4.

With 0.2.2/0.2.3, Psalm hangs at "Scanning files" / "Analyzing files" in about 10% of CI jobs on Linux. Its worker pool (amphp/parallel's ForkContext) forks from inside the running loop. A child's first poll replayed a change the parent had queued at the fork on the parent's epoll instance, which is shared across fork(). That deleted the parent's IPC listener from the instance, and the parent waited in epoll_wait forever. In revolt-rs 0.2.1 a forked child gets its own poller, wait timer and signal wake pipe at its next poll. The cost is one relaxed atomic load per poll.

The lockfile changes only the revolt-rs entry. Locally (macOS, PHP 8.6): cargo build --locked is fine, and a smoke test passes: the native Revolt\EventLoop, a timer, and a pcntl_fork() child running its own loop.

@danog
danog merged commit 9ae320e into master Nov 26, 2026
72 of 74 checks passed
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