Issue #15002 has been updated by k0kubun (Takashi Kokubun).

Assignee changed from k0kubun (Takashi Kokubun) to normalperson (Eric Wong)

Thanks to deal with it. Actually test-all with --jit-wait is running successfully on my Wercker CI and ko1's trunk-mjit-wait for now http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker, but as long as it passes the tests on your environment, it looks good to merge the change to deal with the spurious interrupts by SIGCHLD from MJIT.

> Haven't investigated (I think k0kubun would know better)

I haven't investigated yet either. 

----------------------------------------
Feature #15002: [PATCH] thread.c (sleep_*): reduce the effect of spurious interrupts
https://bugs.ruby-lang.org/issues/15002#change-73594

* Author: normalperson (Eric Wong)
* Status: Open
* Priority: Normal
* Assignee: normalperson (Eric Wong)
* Target version: 
----------------------------------------
```
Spurious interrupts from SIGCHLD cause Mutex#sleep (via
ConditionVariable#wait) to return early and breaks some use
cases.  Since these are outside the programs's control with
MJIT, we will only consider pending interrupts (e.g. those
from Thread#run) and signals which cause a Ruby-level Signal.trap
handler to fire as "spurious" wakeups.

This fixes all the Net::IMAP tests in test-all for me with --jit-wait

Remaining test-all failures with --jit-wait after this patch:

>   1) Failure:
> TestThreadQueue#test_queue_close_multi_multi [/ruby/test/ruby/test_thread_queue.rb:526]:
> no threads running

Seems like the test is too timing-sensitive for producer thread lifetime.

>   2) Failure:
> TestIO#test_recycled_fd_close [/ruby/test/ruby/test_io.rb:3804]:
> Expected /stream closed/ to match "closed stream".

Not sure if solvable with MJIT, the difference is minor and won't
affect real-world tests.  We should probably loosen the test to allow
either "stream closed" or "closed stream"

>   3) Failure:
> TestRubyOptimization#test_tailcall_condition_block [/ruby/test/ruby/test_optimization.rb:439]:
> [ruby-core:78015] [Bug #12905]: 10079 / 20158 stack levels.
> Exception raised:
> <#<SystemStackError: stack level too deep>>.

Haven't investigated (I think k0kubun would know better)

```


---Files--------------------------------
0001-thread.c-sleep_-reduce-the-effect-of-spurious-interr.patch (6.17 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>