system_command: fix rare scenario of interrupt being reported to stderr

This commit is contained in:
Bo Anderson 2021-05-11 02:31:27 +01:00
parent c92a40a751
commit aea107b55a
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65

View File

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