briandunn / flatware

A parallel test runner for RSpec and Cucumber with pretty output
MIT License
256 stars 35 forks source link

Do not crash on EINTR #53

Closed jhottenstein closed 4 years ago

jhottenstein commented 4 years ago

This resolves the test (and runtime) failures for flatware under ruby 2.6.

Looking at other uses of zeromq (https://github.com/zeromq/erlzmq2/pull/67, https://grokbase.com/t/zeromq/zeromq-dev/1416wsc26h/zmq-poll-error#20140106y31s5ps9j4s9gpyqc67wnhpsgr), it seems like the best way to handle an EINTR is to continue polling.

Resolves #51 Related to #44

WaKeMaTTa commented 4 years ago

What is EINTR error exactly?

jhottenstein commented 4 years ago

Interrupted System Call: https://www.gnu.org/software/libc/manual/html_node/Error-Codes.html Its how zmq_poll communicates that it was interrupted before it received anything: http://api.zeromq.org/2-1:zmq-poll

I'm unclear why upgrading to ruby 2.6 made that error always pop up during a flatware rspec run but rescuing the error and continuing to poll seems to be the recommended way to handle that particular signal.

dgilperez commented 4 years ago

Apparently this hit us on our CI. Is this PR ready or something needs doing?