From: normalperson@... Date: 2018-08-17T08:07:51+00:00 Subject: [ruby-core:88510] [Ruby trunk Feature#15002] [PATCH] thread.c (sleep_*): reduce the effect of spurious interrupts Issue #15002 has been reported by normalperson (Eric Wong). ---------------------------------------- Feature #15002: [PATCH] thread.c (sleep_*): reduce the effect of spurious interrupts https://bugs.ruby-lang.org/issues/15002 * Author: normalperson (Eric Wong) * Status: Open * Priority: Normal * Assignee: k0kubun (Takashi Kokubun) * 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: > <#>. 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: