[#67346] Future of test suites for Ruby — Charles Oliver Nutter <headius@...>
I'll try to be brief so we can discuss all this. tl;dr: RubySpec is
19 messages
2015/01/05
[#67353] Re: Future of test suites for Ruby
— Tanaka Akira <akr@...>
2015/01/05
2015-01-06 7:18 GMT+09:00 Charles Oliver Nutter <headius@headius.com>:
[#67444] [ruby-trunk - Feature #10718] [Open] IO#close should not raise IOError on closed IO objects. — akr@...
Issue #10718 has been reported by Akira Tanaka.
3 messages
2015/01/09
[#67689] Keyword Arguments — Anthony Crumley <anthony.crumley@...>
Please forgive my ignorance as I am new to MRI development and am still
5 messages
2015/01/20
[#67733] [ruby-trunk - Bug #10761] Marshal.dump 100% slower in 2.2.0 vs 2.1.5 — normalperson@...
Issue #10761 has been updated by Eric Wong.
4 messages
2015/01/21
[#67736] Re: [ruby-trunk - Bug #10761] Marshal.dump 100% slower in 2.2.0 vs 2.1.5
— Eric Wong <normalperson@...>
2015/01/22
normalperson@yhbt.net wrote:
[#67772] Preventing Redundant Email Messages — Jeremy Evans <code@...>
For a long time, I've wondered why I sometimes receive redundant email
5 messages
2015/01/23
[ruby-core:67847] [ruby-trunk - Bug #10786] SIGINT can not interrupt remaining codes after XMLRPC::Server gets SIGINT
From:
nidev.plontra@...
Date:
2015-01-28 01:36:25 UTC
List:
ruby-core #67847
Issue #10786 has been updated by Changbeom Yun.
In xmlrpc/server.rb line 585-586,
```ruby
signals = %w[INT TERM HUP] & Signal.list.keys
signals.each { |signal| trap(signal) { @server.shutdown } }
```
I found signal traps. This code behaves correctly when XMLRPC::Server is the only one instance which runs alone.
SIGINT (and also other signals) may shutdown XMLRPC::Server if there's no remaining code under the line calling 'serve'.
However, Signal.trap() invoked by XMLRPC::Server.serve() still affects until Ruby reaches at the end of a ruby program.
I think it's reasonable that Signal.trap is considered and installed by a programmer depending on their need. In short, it should be optional.
```diff
--- /usr/lib/ruby/2.2.0/xmlrpc/server.rb 2013-12-07 19:27:27.000000000 +0900
+++ server.rb 2015-01-28 10:27:57.233466656 +0900
@@ -582,9 +582,6 @@
# Call this after you have added all you handlers to the server.
# This method starts the server to listen for XML-RPC requests and answer them.
def serve
- signals = %w[INT TERM HUP] & Signal.list.keys
- signals.each { |signal| trap(signal) { @server.shutdown } }
-
@server.start
end
```
----------------------------------------
Bug #10786: SIGINT can not interrupt remaining codes after XMLRPC::Server gets SIGINT
https://bugs.ruby-lang.org/issues/10786#change-51255
* Author: Changbeom Yun
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
When XMLRPC::Server has started completely, a user presses Ctrl-C to send SIGINT. XMLRPC::Server stops by SIGINT.
Assuming there are remaining codes to be run after XMLRPC::Server stops, When a user tries to press Ctrl-C again to interrupt, it doesn't function.
No exception is raised and a user has to wait until Ruby reaches the end of a program, because SIGINT doesn't work at all.
Code used for test:
```ruby
require "xmlrpc/server"
rpcd = XMLRPC::Server.new
rpcd.serve
puts "Wait 30 seconds in main thread"
sleep 30
puts "Done"
```
Reproducing procedure:
1. Save above source into a Ruby file.
2. Run it with Ruby.
3. Wait until XMLRPC::Server(Actually, WEBrick) message 'INFO WEBrick::HTTPServer#start' appears.
4. Press Ctrl-C. (At this time, WEBrick gets shut down.)
5. When 'Wait 30 seconds in main thread' appears, press Ctrl-C again.
--
https://bugs.ruby-lang.org/