Project

General

Profile

Actions

Bug #10786

closed

SIGINT can not interrupt remaining codes after XMLRPC::Server gets SIGINT

Added by nidev (Changbeom Yun) about 9 years ago. Updated over 7 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
[ruby-core:67839]

Description

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:


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.
Actions

Also available in: Atom PDF

Like0
Like0Like0