oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.16k stars 2.77k forks source link

`Bun.$` waiter thread doesn't idle #8552

Open Jarred-Sumner opened 9 months ago

Jarred-Sumner commented 9 months ago

This only happens when pidfd_open is not supported. It must be using the waiter thread for this to reproduce.

What version of Bun is running?

1.0.24+b1273e53d

What platform is your computer?

Linux x64

What steps can reproduce the bug?

  1. Code:
    
    import { $ } from 'bun';

await $echo hi

setTimeout(() => {}, 100_000);


2. Run

```sh
BUN_FEATURE_FLAG_FORCE_WAITER_THREAD=1 BUN_GARBAGE_COLLECTOR_LEVEL=1 bun ./foo.js

What is the expected behavior?

CPU usage should not be 100%

What do you see instead?

High CPU usage

image

Additional information

No response

cheslip commented 7 months ago

this looks like it's fixed now