Merge pull request #11361 from Bo98/syscommand-race-fix

system_command: fix rare scenario of interrupt being reported to stderr
This commit is contained in:
Bo Anderson 2021-05-11 03:19:50 +01:00 committed by GitHub
commit fca0fb123d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -204,6 +204,8 @@ class SystemCommand
Thread.handle_interrupt(ProcessTerminatedInterrupt => :never) do
each_line_from [raw_stdout, raw_stderr], &block
end
# Handle race conditions with interrupts
Thread.current.report_on_exception = false
rescue ProcessTerminatedInterrupt
nil
end