-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix running Bun.spawn
on Vercel and GCP
#6724
Conversation
@@ -476,11 +476,23 @@ pub fn scoped(comptime tag: @Type(.EnumLiteral), comptime disabled: bool) _log_f | |||
defer lock.unlock(); | |||
|
|||
if (Output.enable_ansi_colors_stderr) { | |||
out.print(comptime prettyFmt("<r><d>[" ++ @tagName(tag) ++ "]<r> " ++ fmt, true), args) catch unreachable; | |||
buffered_writer.flush() catch unreachable; | |||
out.print(comptime prettyFmt("<r><d>[" ++ @tagName(tag) ++ "]<r> " ++ fmt, true), args) catch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was to silence debug logs from throwing "PipeError"
} | ||
|
||
pub fn shouldUseWaiterThread() bool { | ||
return @atomicLoad(bool, &should_use_waiter_thread, .Monotonic); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be fine but why not use std.atomic and/or atomic store when setting
❌ @Jarred-Sumner 2 files with test failures on linux-x64-baseline:
|
❌ @Jarred-Sumner 2 files with test failures on linux-x64:
|
❌ @Jarred-Sumner 5 files with test failures on bun-darwin-aarch64:
|
❌ @Jarred-Sumner 6 files with test failures on bun-darwin-x64-baseline:
|
❌ @Jarred-Sumner 4 files with test failures on bun-darwin-x64:
|
What does this PR do?
pidfd_open
is not implemented by gVisor and by older Linux kernels. This implements a workaround where we spawn a thread, enqueue concurrent tasks and callwaitpid
on eachSubprocess
'spid
. This workaround is very loosely based on libuv's default behavior.Fixes #5803
Need to manually test that it does indeed fix the issue, but it should
How did you verify your code works?
I tested manually + added a hidden environment variable to let us manually enable this for testing purposes