From: eregontp@... Date: 2017-12-12T14:07:47+00:00 Subject: [ruby-core:84216] [Ruby trunk Feature#14143] Thread.report_on_exception should be true by default Issue #14143 has been updated by Eregon (Benoit Daloze). File 0001-Set-Thread.report_on_exception-true-by-default-to-re.patch added The current patch and progress is available at https://github.com/ruby/ruby/compare/trunk...eregon:thread_report_on_exception_by_default Only the first commit (also attached as patch) is needed to "make exam" We found a bug in DRb with report_on report_on_exception: #14171. The second commit fixes it. The first commit sets Thread.report_on_exception=false in test-all to avoid too many warnings, due to tests letting threads die, often in purpose. I'm working on fixing them. ---------------------------------------- Feature #14143: Thread.report_on_exception should be true by default https://bugs.ruby-lang.org/issues/14143#change-68338 * Author: Eregon (Benoit Daloze) * Status: Open * Priority: Normal * Assignee: Eregon (Benoit Daloze) * Target version: 2.5 ---------------------------------------- Extracted from #6647 to focus on the default value now that the feature is implemented. I strongly believe we should have Thread.report_on_exception = true by default. It only adds some extra stderr output for apps which let threads die, which is very rarely intended. If it is intended, then one can use Thread.current.report_on_exception = false to clarify it's OK for that thread to die and the failure is handled by the app on Thread#join. I enabled Thread.report_on_exception=true by default in ruby/spec, see https://github.com/ruby/spec/pull/517, the only cases needing Thread.current.report_on_exception=false are the specs testing report_on_exception itself and Thread#join/value/status/raise. Enabling it for test-all shows a fair amount of extra output and failures, which I would bet some of them are bugs in the tests (I already found one, r60854 & r60870), and other tests should simply more carefully test what they expect (for instance assert_raise() inside the Thread just around the code raising an exception and join the Thread). I am willing to help to reduce the extra output and failures in test-all, but I would like a OK from Matz to try enabling Thread.report_on_exception by default. Dear Matz, do you think it is reasonable to show exceptions killing threads on stderr by default, instead of silently swallowing them until Thread#join ? (if there is ever a Thread#join ..., often not or too late, when the rest of the application has crashed) ---Files-------------------------------- 0001-Set-Thread.report_on_exception-true-by-default-to-re.patch (5.27 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: