diff options
author | 2022-03-14 05:39:45 -0700 | |
---|---|---|
committer | 2022-03-14 05:39:45 -0700 | |
commit | 1316dd1a4fcd25b0a81621b57c5f25c8674cd2db (patch) | |
tree | a4ec0d722c4dd57a2415e5e051fb5a89a3dcb420 | |
parent | 13f1cdca7bdac4b06b4d521e3ea2b371663387ff (diff) | |
download | bun-1316dd1a4fcd25b0a81621b57c5f25c8674cd2db.tar.gz bun-1316dd1a4fcd25b0a81621b57c5f25c8674cd2db.tar.zst bun-1316dd1a4fcd25b0a81621b57c5f25c8674cd2db.zip |
Fix crash when HTTP thread goes to sleep
-rw-r--r-- | src/thread_pool.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/thread_pool.zig b/src/thread_pool.zig index 64dd7d2de..dfdd3ed93 100644 --- a/src/thread_pool.zig +++ b/src/thread_pool.zig @@ -297,7 +297,10 @@ fn _wait(self: *ThreadPool, _is_waking: bool, comptime sleep_on_idle: bool) erro // 10 microseconds * 400 == 4ms if (idle_network_ticks > 40) { idle_network_ticks = 0; - HTTP.cleanup(true); + // force(true) causes an assertion failure + // judging from reading mimalloc's code, + // it should only be used when the thread is about to shutdown + HTTP.cleanup(false); self.idle_event.wait(); } } |