STDOUT redirection is not thread-safe
afn opened this issue · comments
Tony Novak commented
The redirect_stdout
call messes with the global STDOUT
and $stdout
streams in the parent process (not the child process), which can cause issues if other threads are writing to STDOUT.
One simple approach to fix the issue, at least on MRI, is to let Process.spawn
handle the redirection when not running in JRuby. Pull request coming shortly.